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
  • Authentication
  • AWS
  • GCP
  • Data Structure

Was this helpful?

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

Cloud storage (S3, GCP)

PreviousSupabaseNextQueuing services (SQS, Kafka)

Last updated 20 days ago

Was this helpful?

Terra allows you to connect an as a destination, to get all data dumped directly into a bucket of your choice.

Authentication

AWS

All AWS-based destinations follow the same 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/*"
    }
  ]
}

GCP


Data Structure

Versioned objects will be placed under the appropriate API version (in the screenshot above, this corresponds to 2022-03-16. Non versioned objects (e.g. authentication Events) will be placed in their appropriate event type folder, outside of the version folder

In all, every event will have as a parent folder the Event Type which it corresponds to, and will be saved with a unique name identifying it.

As shown above, the name will either be a concatenation of one of the below:

  • For Data Events: the user ID & the start time of the period the event refers to

  • For all other Event Types: the user ID & timestamp the event was generated at

For GCP destinations, you'll need to create a service account, and generate credentials for it. See the guide for further details. once you have generated credentials, download the JSON file with the credentials you just created, and upload it in the corresponding section when setting up your GCP-based destination

When data is sent to your or , it will be dumped using the following folder structure

S3 Bucket
create an IAM user
Attach relevant policies
here
S3 Bucket
GCS
Example for AWS S3