GlobalSecondaryIndexProps

class aws_cdk.aws_dynamodb.GlobalSecondaryIndexProps(*, index_name, non_key_attributes=None, projection_type=None, partition_key, sort_key=None, contributor_insights_enabled=None, max_read_request_units=None, max_write_request_units=None, read_capacity=None, write_capacity=None)

Bases: SecondaryIndexProps, SchemaOptions

Properties for a global secondary index.

Parameters:
  • index_name (str) – The name of the secondary index.

  • non_key_attributes (Optional[Sequence[str]]) – The non-key attributes that are projected into the secondary index. Default: - No additional attributes

  • projection_type (Optional[ProjectionType]) – The set of attributes that are projected into the secondary index. Default: ALL

  • partition_key (Union[Attribute, Dict[str, Any]]) – Partition key attribute definition.

  • sort_key (Union[Attribute, Dict[str, Any], None]) – Sort key attribute definition. Default: no sort key

  • contributor_insights_enabled (Optional[bool]) – Whether CloudWatch contributor insights is enabled for the specified global secondary index. Default: false

  • max_read_request_units (Union[int, float, None]) – The maximum read request units for the global secondary index. Can only be provided if table billingMode is PAY_PER_REQUEST. Default: - on-demand throughput is disabled

  • max_write_request_units (Union[int, float, None]) – The maximum write request units for the global secondary index. Can only be provided if table billingMode is PAY_PER_REQUEST. Default: - on-demand throughput is disabled

  • read_capacity (Union[int, float, None]) – The read capacity for the global secondary index. Can only be provided if table billingMode is Provisioned or undefined. Default: 5

  • write_capacity (Union[int, float, None]) – The write capacity for the global secondary index. Can only be provided if table billingMode is Provisioned or undefined. Default: 5

ExampleMetadata:

infused

Example:

table = dynamodb.Table(self, "Table",
    partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
    contributor_insights_enabled=True
)

table.add_global_secondary_index(
    contributor_insights_enabled=True,  # for a specific global secondary index
    index_name="gsi",
    partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING)
)

Attributes

contributor_insights_enabled

Whether CloudWatch contributor insights is enabled for the specified global secondary index.

Default:

false

index_name

The name of the secondary index.

max_read_request_units

The maximum read request units for the global secondary index.

Can only be provided if table billingMode is PAY_PER_REQUEST.

Default:
  • on-demand throughput is disabled

max_write_request_units

The maximum write request units for the global secondary index.

Can only be provided if table billingMode is PAY_PER_REQUEST.

Default:
  • on-demand throughput is disabled

non_key_attributes

The non-key attributes that are projected into the secondary index.

Default:
  • No additional attributes

partition_key

Partition key attribute definition.

projection_type

The set of attributes that are projected into the secondary index.

Default:

ALL

read_capacity

The read capacity for the global secondary index.

Can only be provided if table billingMode is Provisioned or undefined.

Default:

5

sort_key

Sort key attribute definition.

Default:

no sort key

write_capacity

The write capacity for the global secondary index.

Can only be provided if table billingMode is Provisioned or undefined.

Default:

5