TableAttributes

class aws_cdk.aws_dynamodb.TableAttributes(*, encryption_key=None, global_indexes=None, grant_index_permissions=None, local_indexes=None, table_arn=None, table_name=None, table_stream_arn=None)

Bases: object

Reference to a dynamodb table.

Parameters:
  • encryption_key (Optional[IKey]) – KMS encryption key, if this table uses a customer-managed encryption key. Default: - no key

  • global_indexes (Optional[Sequence[str]]) – The name of the global indexes set for this Table. Note that you need to set either this property, or localIndexes, if you want methods like grantReadData() to grant permissions for indexes as well as the table itself. Default: - no global indexes

  • grant_index_permissions (Optional[bool]) – If set to true, grant methods always grant permissions for all indexes. If false is provided, grant methods grant the permissions only when globalIndexes or localIndexes is specified. Default: - false

  • local_indexes (Optional[Sequence[str]]) – The name of the local indexes set for this Table. Note that you need to set either this property, or globalIndexes, if you want methods like grantReadData() to grant permissions for indexes as well as the table itself. Default: - no local indexes

  • table_arn (Optional[str]) – The ARN of the dynamodb table. One of this, or tableName, is required. Default: - no table arn

  • table_name (Optional[str]) – The table name of the dynamodb table. One of this, or tableArn, is required. Default: - no table name

  • table_stream_arn (Optional[str]) – The ARN of the table’s stream. Default: - no table stream

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_dynamodb as dynamodb
from aws_cdk import aws_kms as kms

# key: kms.Key

table_attributes = dynamodb.TableAttributes(
    encryption_key=key,
    global_indexes=["globalIndexes"],
    grant_index_permissions=False,
    local_indexes=["localIndexes"],
    table_arn="tableArn",
    table_name="tableName",
    table_stream_arn="tableStreamArn"
)

Attributes

encryption_key

KMS encryption key, if this table uses a customer-managed encryption key.

Default:
  • no key

global_indexes

The name of the global indexes set for this Table.

Note that you need to set either this property, or localIndexes, if you want methods like grantReadData() to grant permissions for indexes as well as the table itself.

Default:
  • no global indexes

grant_index_permissions

If set to true, grant methods always grant permissions for all indexes.

If false is provided, grant methods grant the permissions only when globalIndexes or localIndexes is specified.

Default:
  • false

local_indexes

The name of the local indexes set for this Table.

Note that you need to set either this property, or globalIndexes, if you want methods like grantReadData() to grant permissions for indexes as well as the table itself.

Default:
  • no local indexes

table_arn

The ARN of the dynamodb table.

One of this, or tableName, is required.

Default:
  • no table arn

table_name

The table name of the dynamodb table.

One of this, or tableArn, is required.

Default:
  • no table name

table_stream_arn

The ARN of the table’s stream.

Default:
  • no table stream