Redshift

Edited

You can connect Measure to Amazon Redshift to sync your customers, subscriptions, invoices, and payments into your data warehouse for reporting and analysis. Measure writes the data to your Redshift Serverless workgroup through a private connection, so nothing travels over the public internet.

Setup takes place in the AWS account that owns your Redshift workgroup. Measure creates and manages the private endpoint in its own AWS account.

Before you start, email [email protected] to enable the data platforms feature on your account. Ask support for two values you will need in step 6: Measure's AWS account ID and the VPC ID to authorize.

1. Create an S3 staging bucket

Create a dedicated S3 bucket in the same region as your Redshift workgroup. Keep Block Public Access turned on and use SSE-S3 encryption.

Reserve the bucket for Measure. The connection check writes files that start with _airbyte_check_ at the root of the bucket, and each sync writes batches under public/<stream>/. Measure's connection form has no prefix field, so these paths are fixed.

If you encrypt the bucket with AWS KMS, use a customer-managed key. The AWS-managed aws/s3 key does not work.

2. Create a Redshift Serverless namespace and workgroup

Create a Redshift Serverless namespace and workgroup with these settings:

  • Database: measure_db

  • Schema: public

  • SSL: on

Do not enter the standard workgroup endpoint in Measure. After step 7, Measure gives you a private endpoint address to use instead.

3. Create a Redshift IAM role (if you use role-based S3 access)

If your COPY setup uses role-based access to S3, create an IAM role that Redshift can assume and attach it to the namespace.

Limit s3:ListBucket and s3:GetObject to the staging prefixes that Redshift reads. Add KMS access if you use a KMS key.

The role does not replace the staging user in the next step. Measure uses the staging user's credentials for its S3 operations.

4. Create the staging IAM user

Create a dedicated IAM user with no console sign-in, then create an access key for it. IAM users and access keys apply to the whole AWS account, not to a single region.

If you reuse an existing user, review its other permissions first. IAM policies are additive, so the user keeps everything it already has.

Attach the following policy to the user. Replace <staging-bucket> with the name of the bucket from step 1.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ListStagingPrefixes",
      "Effect": "Allow",
      "Action": "s3:ListBucket",
      "Resource": "arn:aws:s3:::<staging-bucket>",
      "Condition": {
        "StringLike": {
          "s3:prefix": ["_airbyte_*", "public/", "public/*"]
        }
      }
    },
    {
      "Sid": "StagingObjects",
      "Effect": "Allow",
      "Action": ["s3:PutObject", "s3:GetObject", "s3:DeleteObject"],
      "Resource": [
        "arn:aws:s3:::<staging-bucket>/_airbyte_*",
        "arn:aws:s3:::<staging-bucket>/public/*"
      ]
    }
  ]
}

This policy grants only the access Measure needs. Enter the access key only in Measure's secure fields, and never use your Redshift password for S3.

5. Create the Redshift database user

Create a database user, for example measure_user, with a strong password stored in your secret manager.

Connect to measure_db as a Redshift admin and run these statements:

GRANT CREATE ON DATABASE measure_db TO measure_user;
GRANT USAGE, CREATE ON SCHEMA public TO measure_user;
GRANT SELECT ON TABLE SVV_TABLE_INFO TO measure_user;

6. Authorize Measure's AWS account

In your Redshift Serverless workgroup, go to Data access > Granted accounts > Grant access.

Add Measure's AWS account ID and the VPC ID that Measure gave you. Both values are available from [email protected].

Never select All VPCs. Authorize only the VPC that Measure provided.

7. Send your details to Measure

Email [email protected] with:

  • The S3 staging bucket name and region

  • The Redshift workgroup name and region

  • Confirmation that you granted access in step 6

Measure creates the private endpoint and sends you its private DNS address. Use that address, not the standard workgroup endpoint, when you finish the connection in Measure.

Measure then initializes your schema and runs the first full sync. Data refreshes daily by default. For the full list of datasets Measure exports, see the Data Platforms article.

Was this article helpful?

Sorry about that! Care to tell us more?

Thanks for the feedback!

There was an issue submitting your feedback
Please check your connection and try again.