Add tags to a new stream for an existing table - Amazon Keyspaces (for Apache Cassandra)
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Add tags to a new stream for an existing table

You can add tags when you create a new stream for an existing table. You can either use the PropagateTagsOnEnable flag to apply the table tags to the stream or specify new tags for the stream. You can use CQL or the Amazon CLI to tag a new stream.

Note

Amazon Keyspaces CDC requires the presence of a service-linked role (AWSServiceRoleForAmazonKeyspacesCDC) that publishes metric data from Amazon Keyspaces CDC streams into the "cloudwatch:namespace": "AWS/Cassandra" in your CloudWatch account on your behalf. This role is created automatically for you. For more information, see Using roles for Amazon Keyspaces CDC streams.

Cassandra Query Language (CQL)
Add tags when creating a new stream
  1. To create a new stream for an existing table and apply the table's tags to the stream, you can use the 'propagate_tags': 'TABLE' flag. The following statements is an example of this.

    ALTER TABLE mytable WITH cdc = TRUE AND CUSTOM_PROPERTIES={ 'cdc_specification': { 'view_type': 'NEW_IMAGE', 'propagate_tags': 'TABLE' } };
  2. To create a new stream for an existing table and specify new tags, you ca use the following example.

    ALTER TABLE mytable WITH cdc = TRUE AND CUSTOM_PROPERTIES={ 'cdc_specification': { 'view_type': 'NEW_IMAGE', 'tags': { 'key': 'string', 'value': 'string' }, } };
CLI
Add tags when creating a new stream using the Amazon CLI
  1. To create a new stream with tags, you can use the propagateTags=TABLE flag to apply the table's tags automatically to the stream. The following code is an example of this.

    aws keyspaces update-table \ --keyspace-name 'my_keyspace' \ --table-name 'my_table' \ --cdc-specification propagateTags=TABLE,status=ENABLED,viewType=NEW_IMAGE
  2. To create a new stream for an existing table and specify new tags, you ca use the following example.

    aws keyspaces update-table \ --keyspace-name 'my_keyspace' \ --table-name 'my_table' \ --cdc-specification propagateTags=TABLE,status=ENABLED,viewType=NEW_IMAGE,tags=[{tag_key=tag_value}]