ReplicaGlobalSecondaryIndexOptions

class aws_cdk.aws_dynamodb.ReplicaGlobalSecondaryIndexOptions(*, contributor_insights=None, max_read_request_units=None, read_capacity=None)

Bases: object

Options used to configure global secondary indexes on a replica table.

Parameters:
  • contributor_insights (Optional[bool]) – Whether CloudWatch contributor insights is enabled for a specific global secondary index on a replica table. Default: - inherited from the primary table

  • max_read_request_units (Union[int, float, None]) – The maximum read request units for a specific global secondary index on a replica table. Note: This can only be configured if primary table billing is PAY_PER_REQUEST. Default: - inherited from the primary table

  • read_capacity (Optional[Capacity]) – The read capacity for a specific global secondary index on a replica table. Note: This can only be configured if primary table billing is provisioned. Default: - inherited from the primary table

ExampleMetadata:

infused

Example:

import aws_cdk as cdk


app = cdk.App()
stack = cdk.Stack(app, "Stack", env=cdk.Environment(region="us-west-2"))

global_table = dynamodb.TableV2(stack, "GlobalTable",
    partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
    contributor_insights=True,
    billing=dynamodb.Billing.provisioned(
        read_capacity=dynamodb.Capacity.fixed(10),
        write_capacity=dynamodb.Capacity.autoscaled(max_capacity=10)
    ),
    # each global secondary index will inherit contributor insights as true
    global_secondary_indexes=[dynamodb.GlobalSecondaryIndexPropsV2(
        index_name="gsi1",
        partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
        read_capacity=dynamodb.Capacity.fixed(15)
    ), dynamodb.GlobalSecondaryIndexPropsV2(
        index_name="gsi2",
        partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
        write_capacity=dynamodb.Capacity.autoscaled(min_capacity=5, max_capacity=20)
    )
    ],
    replicas=[dynamodb.ReplicaTableProps(
        region="us-east-1",
        global_secondary_index_options={
            "gsi1": dynamodb.ReplicaGlobalSecondaryIndexOptions(
                read_capacity=dynamodb.Capacity.autoscaled(min_capacity=1, max_capacity=10)
            )
        }
    ), dynamodb.ReplicaTableProps(
        region="us-east-2",
        global_secondary_index_options={
            "gsi2": dynamodb.ReplicaGlobalSecondaryIndexOptions(
                contributor_insights=False
            )
        }
    )
    ]
)

Attributes

contributor_insights

Whether CloudWatch contributor insights is enabled for a specific global secondary index on a replica table.

Default:
  • inherited from the primary table

max_read_request_units

The maximum read request units for a specific global secondary index on a replica table.

Note: This can only be configured if primary table billing is PAY_PER_REQUEST.

Default:
  • inherited from the primary table

read_capacity

The read capacity for a specific global secondary index on a replica table.

Note: This can only be configured if primary table billing is provisioned.

Default:
  • inherited from the primary table