Required AWS instance profile permissions
Configure the required permissions for Structural to work with AWS components.
Set up the AWS Lambda role
Configure the required Lambda role for the Structural Lambda function.
Required KMS permissions for SQS message encryption
Needed if you use KMS for SQS encryption.
Configure Structural environment settings
Environment settings that are specific to Amazon Redshift.
Required database permissions
Configure the required permissions for source and destination databases.
The AWS Lambda function that Tonic Structural sets up requires an AWS role. The name of this role is set by the following environment setting:
The policy for this role should look like this:
The above policy grants the Lambda function the required access to Amazon SQS, Amazon S3, and CloudWatch.
This policy assumes that the S3 buckets and Amazon SQS queues that are used begin with the tonic-
prefix.
After you create the role, you must allow the Lambda service to assume the role.
For the role, the Trust relationships in the AWS IAM role should look like the following:
When it uses Amazon Redshift, Tonic Structural orchestrates the creation, usage, and deletion of several AWS components.
The required permissions to do so are taken from the instance profile role of the machine that runs Structural's server. This role (EC2) needs the permissions listed below.
Note that these permissions are starting point. Based on your exact AWS setup, you might need to add additional permissions. For example, if you use AWS KMS on your S3 buckets, then you might need to grant AWS Key Management Service (AWS KMS) access. Go to the instructions on how to use AWS KMS encryption with Structural's programmatically generated Amazon SQS queues.
The above policy allows Structural to properly orchestrate jobs in your AWS infrastructure. It assumes that you use default names for objects in AWS, and that your source and destination S3 buckets begin with the tonic-
prefix.
Tonic Structural allows you to set several Amazon Redshift-specific environment settings that make it easier to adapt our Amazon Redshift integration into your specific AWS environment.
You configure these settings in the Structural worker container.
If you use AWS KMS for Amazon SQS encryption, make sure that you provided the correct key ID for the Tonic Structural environment setting TONIC_LAMBDA_KMS_MASTER_KEY
.
Also provide Amazon S3 access under your AWS KMS key policy:
Additional key permissions must be added to your Amazon EC2 and Lambda roles:
The following is an example of how to create an Amazon Redshift user with the permissions needed to connect to Tonic Structural.
We recommend that you use a backup as your source database instead of connecting directly to your production environment.
If your database contains additional schemas that are included, then you must also run the same commands for those schemas.
The destination database must exist before Structural can connect to it. The user provided to Structural for connecting to the destination database must be a superuser who holds ownership and privileges of all schemas and tables.