Sources
Connect Amazon Keyspaces as a source
Connect Amazon Keyspaces (for Apache Cassandra) as a source in Artie. Create an IAM policy, turn on a change data capture (CDC) stream for each table, then add the connection in pipeline setup.
Prerequisites
- An Amazon Keyspaces keyspace that holds the tables you want to replicate.
- An IAM user with an access key, or an IAM role that Artie assumes. Create an IAM policy lists the permissions.
- A CDC stream turned on for each table you want to replicate. Turn on a CDC stream for each table covers the view type.
- The service endpoint and port for your AWS Region, for example
cassandra.us-east-1.amazonaws.comand9142.
Artie connects to the service endpoint over TLS 1.2 or later. Amazon Keyspaces sources have no SSH tunnel option, so pipeline setup has no Network access step for them.
Create an IAM policy
Artie makes four kinds of calls to Amazon Keyspaces:
- CQL reads of each table, for backfills.
- CQL reads of the
systemandsystem_schematables, to test the connection and read column types and primary keys. - Amazon Keyspaces API calls (
ListKeyspacesandGetTable), to list keyspaces and show a table’s details. - Keyspaces Streams API calls, to list each keyspace’s streams and read changes.
Attach this policy to the IAM user or role. It allows all four for every table in the keyspace my_keyspace:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "cassandra:Select",
"Resource": [
"arn:aws:cassandra:us-east-1:123456789012:/keyspace/my_keyspace/table/*",
"arn:aws:cassandra:us-east-1:123456789012:/keyspace/system*"
]
},
{
"Effect": "Allow",
"Action": [
"cassandra:GetStream",
"cassandra:GetShardIterator",
"cassandra:GetRecords"
],
"Resource": "arn:aws:cassandra:us-east-1:123456789012:/keyspace/my_keyspace/table/*/stream/*"
},
{
"Effect": "Allow",
"Action": "cassandra:ListStreams",
"Resource": "*"
}
]
}Replace us-east-1 with your Region, 123456789012 with your AWS account ID and my_keyspace with your keyspace. The system* resource covers the ListKeyspaces and GetTable calls, which need cassandra:Select on the system tables.
Allow Artie to assume a role
To sign in with a role instead of an access key, add a trust policy that lets Artie’s AWS principal assume the role. The external-ID condition is optional. Include it only when you enter an AWS external ID (optional) value in Artie, and replace my-external-id with that exact value.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::788826912768:user/ci"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"sts:ExternalId": "my-external-id"
}
}
}
]
}On a data plane you run yourself, trust the IAM identity your data plane runs as instead of Artie’s principal.
Turn on a CDC stream for each table
Artie reads changes from a table’s CDC stream, so each table you replicate needs its own stream.
- In the Amazon Keyspaces console, select Tables, then select the table.
- On the Streams tab, select Edit, then select Turn on streams.
- Set View type to New and old images (
NEW_AND_OLD_IMAGES, preferred) or New image (NEW_IMAGE). You can’t change it after the stream is created. - Select Save changes.
Artie accepts a stream only when its status is ENABLED and its view type is one of those two. You enter each stream’s ARN in Artie as the table’s Stream ARN.

Add Amazon Keyspaces in Artie
These steps cover the Source and Tables sections of pipeline setup. If you reuse an Amazon Keyspaces source from another pipeline, setup skips Prepare source.
Choose Amazon Keyspaces
On Choose source, select Amazon Keyspaces (Cassandra).
Check the CDC streams
Prepare source reminds you to turn on CDC for each table. Continue once every table has a stream.
Enter the connection settings
On Connect and verify, fill in these fields:
Field Value Service endpoint The Keyspaces endpoint for your Region, for example cassandra.us-east-1.amazonaws.comPort 9142, which Artie fills in for youAuthentication method Static credentials or Role assumption AWS region The Region of your keyspace Keyspace name The keyspace that holds your tables The credential fields depend on the authentication method:
- Static credentials: enter the AWS access key ID and AWS secret access key.
- Role assumption: enter the AWS role ARN. AWS external ID (optional) must match the trust policy’s
sts:ExternalIdvalue.
Verify the source
Select Verify source. Artie connects to the keyspace and runs a test query. The step shows Source verified.
Choose tables and set each Stream ARN
On Choose tables, turn on each table you want to replicate.
A table with no CDC stream is greyed out with the message “This table is unreadable. Turn on change streams for this table.”
For each table, select Columns and settings, open Advanced options, then enter the Stream ARN. A table without a stream ARN fails Artie’s table check.
To change a table’s stream on an existing pipeline, open the table’s advanced settings on the pipeline page. Select Override Stream ARN, then enter the Stream ARN.
Verify the connection
Source verified on Connect and verify confirms the credentials and the keyspace. Artie then checks the stream of every selected table. Each of these conditions fails that check:
- A table has no stream ARN.
- The stream’s status isn’t
ENABLED. - The stream’s view type isn’t
NEW_AND_OLD_IMAGESorNEW_IMAGE. - The stream belongs to a different keyspace or table.
Next steps
Was this page helpful?
- Need help? Message us on Slack or email [email protected].
- Want a walkthrough? Book a demo.
- LLM? Read llms.txt.