Terra Docs
Dashboard
  • Docs
  • API Reference
  • Changelog
  • Getting Started
    • What is Terra API?
    • Account setup and API keys
    • Core concepts
  • Health & Fitness API
    • Overview
    • Quickstart
    • Integration setup
      • Understanding sources and destinations
      • Setting up data sources
      • Setting up data destinations
        • Webhooks
        • SQL database (Postgres, MySQL)
        • Supabase
        • Cloud storage (S3, GCP)
        • Queuing services (SQS, Kafka)
      • Customising data types
      • Dedicated data source API keys
      • Understanding Terra environments
    • User authentication
      • Authentication flow
      • Implementation (Terra widget)
      • Implementation (Custom UI)
      • Handling authentication events
      • Customising authentication redirects
    • Managing user health data
      • Receiving health data updates (events)
      • Requesting historical health data (REST API requests)
      • Writing data
    • Mobile-only sources
      • iOS (Swift)
      • Android (Kotlin)
      • React Native
      • Flutter
    • Troubleshooting
    • Pricing
  • User Engagement
    • Health Scores
  • Streaming API
    • Overview
    • Wearable -> Your app
      • iOS (Swift)
      • Android
    • Your app -> Terra
      • iOS (Swift)
      • Android
    • Terra -> Your backend
  • Teams API
  • Biomarkers API - Upcoming
Powered by GitBook
On this page
  • AWS SQS (Simple Queue Service)
  • Data Structure

Was this helpful?

  1. Health & Fitness API
  2. Integration setup
  3. Setting up data destinations

Queuing services (SQS, Kafka)

PreviousCloud storage (S3, GCP)NextCustomising data types

Last updated 20 days ago

Was this helpful?

AWS SQS (Simple Queue Service)

is a managed queuing system allowing you to get messages delivered straight into your existing queue, minimising the potential of disruptions and barriers that may occur when ingesting a request from Terra API to your server.

Authentication for AWS destinations

All AWS-based require the following authentication setup.


IAM User Access Key

The most basic way to allow Terra to write to your AWS resource is to with access limited to the resource you're trying to grant Terra access to. for access to the specific resource, (write access is generally the only one needed, unless specified otherwise)


Role-based access

In order to use role-based access, attach the following policy to your bucket:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::760292141147:role/EC2_Instance_Perms"
      },
      "Action": [
        "s3:GetObject",
        "s3:PutObject",
        "s3:DeleteObject"
      ],
      "Resource": "arn:aws:s3:::your-bucket-name/*"
    }
  ]
}

Data Structure

Data sent to SQS can either take the type of healthcheck or s3_payload. See for further details.

Each of these payloads will be a simple JSON payload formatted as in the diagram above. the url field in the data payload will be a download link from which you will need to download the data payload using a GET request. This is done to minimise the size of messages in your queue.

Note: Terra offers the possibility of using your own S3 bucket in combination with the SQS destination. For setting this up, kindly contact Terra support.

The URL will be a to an object stored in one of Terra's S3 buckets.

AWS SQS
create an IAM user
Attach relevant policies
pre-signed link