Amazon Keyspaces
Source
Polytomic connects to Amazon Keyspaces using one of three methods:
- AWS Access Key and Secret.
- AWS IAM role.
- Service-specific credentials (see Amazon's service-specific credentials documentation).
CDC requires an access key or IAM roleReading change data capture (CDC) streams requires an access key or IAM role. Service-specific credentials support only full-table reads.
-
In Polytomic, go to Connections → Add connection → Amazon Keyspaces.
-
Enter your AWS region.
-
Select your Keyspaces authentication method and enter its details:
- Access Key and Secret: the access key ID and secret access key of an IAM user with the permissions below.
- IAM Role: the ARN of a role with the permissions below that Polytomic can assume. See IAM role trust policy.
- Service-Specific Credentials: the username and password generated for an IAM user in the IAM console.
-
Optional: check Use Amazon Keyspaces CDC streams for bulk syncs to read incremental changes from CDC streams instead of rescanning tables. See CDC streams below.
-
Click Save.
IAM permissions
Polytomic reads your tables and their schema over CQL. This requires cassandra:Select on the keyspaces you sync and on the system keyspaces:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "cassandra:Select",
"Resource": [
"arn:aws:cassandra:us-east-1:111122223333:/keyspace/my_keyspace/*",
"arn:aws:cassandra:us-east-1:111122223333:/keyspace/system*"
]
}
]
}Replace the region, account ID, and keyspace name with your own. Add a resource line for each keyspace you want to sync.
IAM role trust policy
When you use the IAM Role method, the role must trust Polytomic's AWS account. After you click Save, Polytomic displays an External ID on the connection. The External ID is your Polytomic Organization's ID, so it's the same for every IAM role connection in your Organization. Require it in the role's trust policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::568237466542:root"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"sts:ExternalId": "<External ID from Polytomic>"
}
}
}
]
}See IAM role authentication to AWS for more about trust policies, including how to restrict assumption to Polytomic's service role.
CDC streams
When Use Amazon Keyspaces CDC streams for bulk syncs is checked, Bulk Syncs read changes from each table's CDC stream. Streams must use the New and old images (NEW_AND_OLD_IMAGES) view type. Polytomic can't read streams with any other view type.
You can enable streams yourself. Alternatively, check Let Polytomic manage Amazon Keyspaces CDC stream settings and Polytomic enables them for you.
Polytomic-managed streamsWhen Polytomic manages CDC settings, it enables a stream with the
NEW_AND_OLD_IMAGESview type and amanaged_by: polytomictag on each table selected for syncing. It replaces any stream with a different view type.Polytomic disables CDC on each table it synced when you delete or reset a Bulk Sync that uses managed streams, or turn off CDC on the connection. This includes streams that existed before you connected Polytomic. If other applications consume a table's stream, manage the stream yourself.
To read CDC streams, add this statement to the policy's Statement list:
{
"Effect": "Allow",
"Action": [
"cassandra:ListStreams",
"cassandra:GetStream",
"cassandra:GetShardIterator",
"cassandra:GetRecords"
],
"Resource": "*"
}If Polytomic manages stream settings, also add the following statements. They let Polytomic alter and tag the synced tables, and create the Keyspaces CDC service-linked role the first time CDC is enabled in your account:
[
{
"Effect": "Allow",
"Action": [
"cassandra:Alter",
"cassandra:TagResource"
],
"Resource": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/my_keyspace/*"
},
{
"Effect": "Allow",
"Action": "iam:CreateServiceLinkedRole",
"Resource": "arn:aws:iam::*:role/aws-service-role/cassandra-streams.amazonaws.com/AWSServiceRoleForAmazonKeyspacesCDC",
"Condition": {
"StringLike": {
"iam:AWSServiceName": "cassandra-streams.amazonaws.com"
}
}
}
]See AWS's CDC permissions documentation for more detail.
Syncing from Amazon Keyspaces
Use Bulk Syncs to sync from Amazon Keyspaces to data warehouses, databases, and cloud storage buckets.
Use Model Syncs to sync from Amazon Keyspaces to SaaS applications, spreadsheets, and webhooks.
Updated about 1 month ago