Creating integrations with Amazon S3 Tables
This is preview documentation for the Aurora PostgreSQL integration with Amazon S3
Tables. Before using this capability, review the Betas and Previews terms in
the AWS Service
Terms
When you create an Aurora PostgreSQL integration with Amazon S3 Tables, you specify the source Aurora DB cluster and the target Amazon S3 Tables table bucket. You also specify data rules that choose the data to replicate and set the target prefix, which the integration uses to name the namespaces it creates in the table bucket. Optionally, you can choose a customer managed key for encryption and add tags. Aurora creates the integration, runs the initial full sync, and then replicates changes from the source DB cluster to the target table bucket.
This page describes how to create an integration with the AWS Management Console and the AWS CLI. You can
also use the CreateIntegration operation of the Amazon RDS API.
Topics
Prerequisites
Before you create an integration, set up a source Aurora DB cluster and a target table bucket with a resource policy. For instructions, see Getting started with Aurora zero-ETL integrations and Step 3c: Create a target Amazon S3 Tables table bucket.
A source table must have a primary key to replicate. To find the tables that do not have one, see the query in Adding data to the source DB cluster.
Required permissions
The IAM principal (user or role) that creates an integration with Amazon S3 Tables needs the following AWS Identity and Access Management (IAM) permissions:
-
Permission to create the integration, for example
rds:CreateIntegration. -
The
s3tables:GetTableBucket,s3tables:CreateNamespace, ands3tables:DeleteNamespacepermissions on the target table bucket. For a table bucket in another account, see Using a table bucket in another account. -
If the source DB cluster or the integration uses a customer managed AWS Key Management Service (AWS KMS) key, permissions on the key, including
kms:DescribeKey,kms:Decrypt, andkms:CreateGrant. For the key policies, see Data protection and encryption.
Creating an integration with the console
Use the following procedure to create an integration in the Amazon RDS console.
To create an integration with Amazon S3 Tables
Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/
. -
In the navigation pane, choose Integrations.
-
Choose Create integration, and then choose Integrate with S3 Tables.
-
For Integration identifier, enter a name. The name must be unique across the integrations in your account in the current Region. It can have 1 to 63 alphanumeric characters or hyphens, and the first character must be a letter. It cannot end with a hyphen or contain two consecutive hyphens.
-
Under Source, for Source database, choose the source Aurora DB cluster. To choose from a list, choose Browse databases.
If the DB cluster parameters are not set for replication, the console asks you to update the parameter group and reboot before you continue. For the required parameters, see Step 1: Create a custom DB cluster parameter group.
-
Under Destination, for S3 table bucket, choose an existing table bucket, or choose Create new S3 table bucket. To use a table bucket in another account, choose Specify a different account for the destination resource.
For the setup that a table bucket in another account needs, see Using a table bucket in another account.
-
Under Data rules, choose which data to replicate and set the target prefix. Use the Visual editor to choose a template and set rules, or choose JSON to enter the rules directly.
The first rule sets the target prefix, and the second rule selects the databases, schemas, and tables to replicate. The default template replicates all databases and tables. For the syntax, see Data rules for integrations with Amazon S3 Tables.
-
(Optional) Under Encryption, the integration uses an AWS owned key by default. To use a customer managed AWS KMS key, choose Customize encryption settings, and then choose the key. For more information, see Encrypting the integration with a customer managed key.
-
(Optional) Under Tags, choose Add new tag, and then enter a key and value.
-
Choose Create integration.
If creation fails, see I cannot create an integration with Amazon S3 Tables.
To confirm that the integration is created, see Monitoring creation progress.
Creating an integration with the AWS CLI
To create an integration with the AWS CLI, use the create-integration command. Specify an integration name, the Amazon Resource Name (ARN) of the source Aurora DB cluster, the ARN of the target table bucket, and data rules that choose the data to replicate and set the target prefix.
Example
For Linux, macOS, or Unix:
aws rds create-integration \ --integration-namemy-s3tables-integration\ --source-arn arn:aws:rds:us-east-1:111122223333:cluster:my-source-cluster\ --target-arn arn:aws:s3tables:us-east-1:111122223333:bucket/my-table-bucket\ --data-rules '[{"Database":"*","Schema":"*","Table":"*","Properties":{"TargetPrefix":"my_prefix"}}]'
For Windows:
Save the JSON array from the --data-rules value in the preceding
example (without the surrounding single quotes) to a file named
data-rules.json, replace my_prefix with
your prefix, and then run the following command from the folder that contains the
file.
aws rds create-integration ^ --integration-namemy-s3tables-integration^ --source-arn arn:aws:rds:us-east-1:111122223333:cluster:my-source-cluster^ --target-arn arn:aws:s3tables:us-east-1:111122223333:bucket/my-table-bucket^ --data-rules file://data-rules.json
The command has the following required options:
-
--integration-name: A name for the integration. It must be unique across the integrations in your account in the current Region. The name appears in the console and in thedescribe-integrationsoutput. To describe, modify, resync, or delete the integration, use the integration ARN or ID, not its name. Thecreate-integrationcommand returns the ARN in theIntegrationArnfield of its output. -
--source-arn: The ARN of the source Aurora DB cluster. -
--target-arn: The ARN of the target table bucket. For the Region requirement, see Limitations for integrations with Amazon S3 Tables. -
--data-rules: The data rules that choose what to replicate and set the target prefix, passed as a JSON string. Every integration must set aTargetPrefix, which names the namespaces that it creates. Each integration that writes to the same table bucket must use a different prefix. The example replicates everything with the prefixmy_prefix. To avoid shell quoting problems, pass the rules as a well-formed JSON string or read them from a file. For the syntax, see Data rules for integrations with Amazon S3 Tables.
You can also use the following options:
-
--kms-key-id: The AWS KMS key that encrypts the integration. If you omit it, RDS uses an AWS owned key. For more information, see Encrypting the integration with a customer managed key. -
--additional-encryption-context: Non-secret key-value pairs that add context for the encryption key. You can use it only with--kms-key-id. -
--description: A description of the integration. -
--tags: Tags to apply to the integration.
To confirm that the integration is created, see Monitoring creation progress.
Encrypting the integration with a customer managed key
By default, RDS encrypts the integration with an AWS owned key. To use a customer
managed AWS KMS key instead, specify it with --kms-key-id when you create the
integration, or choose it in the console. To add encryption context, use
--additional-encryption-context, which you can use only with
--kms-key-id. For example: --kms-key-id
arn:aws:kms:.us-east-1:111122223333:key/key-id
--additional-encryption-context
department=analytics
The source DB cluster and the target table bucket can also use customer managed keys. As a result, up to three keys can be involved: the source DB cluster key, the integration key, and the table bucket key. For the key policy that each key needs, see Data protection and encryption.
Monitoring creation progress
While Aurora sets up the integration, its status is creating. When the
initial full sync completes and the integration is ready to replicate, the status
changes to active.
To check the status with the AWS CLI, use the describe-integrations
command.
Example
For Linux, macOS, or Unix:
aws rds describe-integrations \ --integration-identifier arn:aws:rds:us-east-1:111122223333:integration:5b9f3d2e-1111-2222-3333-444455556666
For Windows:
aws rds describe-integrations ^ --integration-identifier arn:aws:rds:us-east-1:111122223333:integration:5b9f3d2e-1111-2222-3333-444455556666
To check the status in the RDS console, choose Integrations in the navigation pane, and check the Status column for your integration.
For more information, see Viewing an integration and Integration statuses.
Next steps
After the integration has a status of active, add data to the source
DB cluster and query it in the target table bucket. For instructions, see Adding data to a source Aurora DB cluster and querying it in Amazon S3 Tables.