CfnTable

class aws_cdk.aws_dynamodb.CfnTable(scope, id, *, key_schema, attribute_definitions=None, billing_mode=None, contributor_insights_specification=None, deletion_protection_enabled=None, global_secondary_indexes=None, import_source_specification=None, kinesis_stream_specification=None, local_secondary_indexes=None, on_demand_throughput=None, point_in_time_recovery_specification=None, provisioned_throughput=None, resource_policy=None, sse_specification=None, stream_specification=None, table_class=None, table_name=None, tags=None, time_to_live_specification=None)

Bases: CfnResource

The AWS::DynamoDB::Table resource creates a DynamoDB table. For more information, see CreateTable in the Amazon DynamoDB API Reference .

You should be aware of the following behaviors when working with DynamoDB tables:

  • AWS CloudFormation typically creates DynamoDB tables in parallel. However, if your template includes multiple DynamoDB tables with indexes, you must declare dependencies so that the tables are created sequentially. Amazon DynamoDB limits the number of tables with secondary indexes that are in the creating state. If you create multiple tables with indexes at the same time, DynamoDB returns an error and the stack operation fails. For an example, see DynamoDB Table with a DependsOn Attribute .

Our guidance is to use the latest schema documented here for your AWS CloudFormation templates. This schema supports the provisioning of all table settings below. When using this schema in your AWS CloudFormation templates, please ensure that your Identity and Access Management ( IAM ) policies are updated with appropriate permissions to allow for the authorization of these setting changes.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html

CloudformationResource:

AWS::DynamoDB::Table

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

# policy_document: Any

cfn_table = dynamodb.CfnTable(self, "MyCfnTable",
    key_schema=[dynamodb.CfnTable.KeySchemaProperty(
        attribute_name="attributeName",
        key_type="keyType"
    )],

    # the properties below are optional
    attribute_definitions=[dynamodb.CfnTable.AttributeDefinitionProperty(
        attribute_name="attributeName",
        attribute_type="attributeType"
    )],
    billing_mode="billingMode",
    contributor_insights_specification=dynamodb.CfnTable.ContributorInsightsSpecificationProperty(
        enabled=False
    ),
    deletion_protection_enabled=False,
    global_secondary_indexes=[dynamodb.CfnTable.GlobalSecondaryIndexProperty(
        index_name="indexName",
        key_schema=[dynamodb.CfnTable.KeySchemaProperty(
            attribute_name="attributeName",
            key_type="keyType"
        )],
        projection=dynamodb.CfnTable.ProjectionProperty(
            non_key_attributes=["nonKeyAttributes"],
            projection_type="projectionType"
        ),

        # the properties below are optional
        contributor_insights_specification=dynamodb.CfnTable.ContributorInsightsSpecificationProperty(
            enabled=False
        ),
        on_demand_throughput=dynamodb.CfnTable.OnDemandThroughputProperty(
            max_read_request_units=123,
            max_write_request_units=123
        ),
        provisioned_throughput=dynamodb.CfnTable.ProvisionedThroughputProperty(
            read_capacity_units=123,
            write_capacity_units=123
        )
    )],
    import_source_specification=dynamodb.CfnTable.ImportSourceSpecificationProperty(
        input_format="inputFormat",
        s3_bucket_source=dynamodb.CfnTable.S3BucketSourceProperty(
            s3_bucket="s3Bucket",

            # the properties below are optional
            s3_bucket_owner="s3BucketOwner",
            s3_key_prefix="s3KeyPrefix"
        ),

        # the properties below are optional
        input_compression_type="inputCompressionType",
        input_format_options=dynamodb.CfnTable.InputFormatOptionsProperty(
            csv=dynamodb.CfnTable.CsvProperty(
                delimiter="delimiter",
                header_list=["headerList"]
            )
        )
    ),
    kinesis_stream_specification=dynamodb.CfnTable.KinesisStreamSpecificationProperty(
        stream_arn="streamArn",

        # the properties below are optional
        approximate_creation_date_time_precision="approximateCreationDateTimePrecision"
    ),
    local_secondary_indexes=[dynamodb.CfnTable.LocalSecondaryIndexProperty(
        index_name="indexName",
        key_schema=[dynamodb.CfnTable.KeySchemaProperty(
            attribute_name="attributeName",
            key_type="keyType"
        )],
        projection=dynamodb.CfnTable.ProjectionProperty(
            non_key_attributes=["nonKeyAttributes"],
            projection_type="projectionType"
        )
    )],
    on_demand_throughput=dynamodb.CfnTable.OnDemandThroughputProperty(
        max_read_request_units=123,
        max_write_request_units=123
    ),
    point_in_time_recovery_specification=dynamodb.CfnTable.PointInTimeRecoverySpecificationProperty(
        point_in_time_recovery_enabled=False
    ),
    provisioned_throughput=dynamodb.CfnTable.ProvisionedThroughputProperty(
        read_capacity_units=123,
        write_capacity_units=123
    ),
    resource_policy=dynamodb.CfnTable.ResourcePolicyProperty(
        policy_document=policy_document
    ),
    sse_specification=dynamodb.CfnTable.SSESpecificationProperty(
        sse_enabled=False,

        # the properties below are optional
        kms_master_key_id="kmsMasterKeyId",
        sse_type="sseType"
    ),
    stream_specification=dynamodb.CfnTable.StreamSpecificationProperty(
        stream_view_type="streamViewType",

        # the properties below are optional
        resource_policy=dynamodb.CfnTable.ResourcePolicyProperty(
            policy_document=policy_document
        )
    ),
    table_class="tableClass",
    table_name="tableName",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    time_to_live_specification=dynamodb.CfnTable.TimeToLiveSpecificationProperty(
        enabled=False,

        # the properties below are optional
        attribute_name="attributeName"
    )
)
Parameters:
  • scope (Construct) – Scope in which this resource is defined.

  • id (str) – Construct identifier for this resource (unique in its scope).

  • key_schema (Union[IResolvable, Sequence[Union[IResolvable, KeySchemaProperty, Dict[str, Any]]]]) – Specifies the attributes that make up the primary key for the table. The attributes in the KeySchema property must also be defined in the AttributeDefinitions property.

  • attribute_definitions (Union[IResolvable, Sequence[Union[IResolvable, AttributeDefinitionProperty, Dict[str, Any]]], None]) – A list of attributes that describe the key schema for the table and indexes. This property is required to create a DynamoDB table. Update requires: Some interruptions . Replacement if you edit an existing AttributeDefinition.

  • billing_mode (Optional[str]) – Specify how you are charged for read and write throughput and how you manage capacity. Valid values include: - PROVISIONED - We recommend using PROVISIONED for predictable workloads. PROVISIONED sets the billing mode to Provisioned Mode . - PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable workloads. PAY_PER_REQUEST sets the billing mode to On-Demand Mode . If not specified, the default is PROVISIONED .

  • contributor_insights_specification (Union[IResolvable, ContributorInsightsSpecificationProperty, Dict[str, Any], None]) – The settings used to enable or disable CloudWatch Contributor Insights for the specified table.

  • deletion_protection_enabled (Union[bool, IResolvable, None]) – Determines if a table is protected from deletion. When enabled, the table cannot be deleted by any user or process. This setting is disabled by default. For more information, see Using deletion protection in the Amazon DynamoDB Developer Guide .

  • global_secondary_indexes (Union[IResolvable, Sequence[Union[IResolvable, GlobalSecondaryIndexProperty, Dict[str, Any]]], None]) – Global secondary indexes to be created on the table. You can create up to 20 global secondary indexes. .. epigraph:: If you update a table to include a new global secondary index, AWS CloudFormation initiates the index creation and then proceeds with the stack update. AWS CloudFormation doesn’t wait for the index to complete creation because the backfilling phase can take a long time, depending on the size of the table. You can’t use the index or update the table until the index’s status is ACTIVE . You can track its status by using the DynamoDB DescribeTable command. If you add or delete an index during an update, we recommend that you don’t update any other resources. If your stack fails to update and is rolled back while adding a new index, you must manually delete the index. Updates are not supported. The following are exceptions: - If you update either the contributor insights specification or the provisioned throughput values of global secondary indexes, you can update the table without interruption. - You can delete or add one global secondary index without interruption. If you do both in the same update (for example, by changing the index’s logical ID), the update fails.

  • import_source_specification (Union[IResolvable, ImportSourceSpecificationProperty, Dict[str, Any], None]) – Specifies the properties of data being imported from the S3 bucket source to the table. .. epigraph:: If you specify the ImportSourceSpecification property, and also specify either the StreamSpecification , the TableClass property, or the DeletionProtectionEnabled property, the IAM entity creating/updating stack must have UpdateTable permission.

  • kinesis_stream_specification (Union[IResolvable, KinesisStreamSpecificationProperty, Dict[str, Any], None]) – The Kinesis Data Streams configuration for the specified table.

  • local_secondary_indexes (Union[IResolvable, Sequence[Union[IResolvable, LocalSecondaryIndexProperty, Dict[str, Any]]], None]) – Local secondary indexes to be created on the table. You can create up to 5 local secondary indexes. Each index is scoped to a given hash key value. The size of each hash key can be up to 10 gigabytes.

  • on_demand_throughput (Union[IResolvable, OnDemandThroughputProperty, Dict[str, Any], None]) –

  • point_in_time_recovery_specification (Union[IResolvable, PointInTimeRecoverySpecificationProperty, Dict[str, Any], None]) – The settings used to enable point in time recovery.

  • provisioned_throughput (Union[IResolvable, ProvisionedThroughputProperty, Dict[str, Any], None]) – Throughput for the specified table, which consists of values for ReadCapacityUnits and WriteCapacityUnits . For more information about the contents of a provisioned throughput structure, see Amazon DynamoDB Table ProvisionedThroughput . If you set BillingMode as PROVISIONED , you must specify this property. If you set BillingMode as PAY_PER_REQUEST , you cannot specify this property.

  • resource_policy (Union[IResolvable, ResourcePolicyProperty, Dict[str, Any], None]) – A resource-based policy document that contains permissions to add to the specified table. In a CloudFormation template, you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to DynamoDB . For more information about resource-based policies, see Using resource-based policies for DynamoDB and Resource-based policy examples . When you attach a resource-based policy while creating a table, the policy creation is strongly consistent . For information about the considerations that you should keep in mind while attaching a resource-based policy, see Resource-based policy considerations .

  • sse_specification (Union[IResolvable, SSESpecificationProperty, Dict[str, Any], None]) – Specifies the settings to enable server-side encryption.

  • stream_specification (Union[IResolvable, StreamSpecificationProperty, Dict[str, Any], None]) – The settings for the DynamoDB table stream, which capture changes to items stored in the table.

  • table_class (Optional[str]) – The table class of the new table. Valid values are STANDARD and STANDARD_INFREQUENT_ACCESS .

  • table_name (Optional[str]) – A name for the table. If you don’t specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the table name. For more information, see Name Type . .. epigraph:: If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – An array of key-value pairs to apply to this resource. For more information, see Tag .

  • time_to_live_specification (Union[IResolvable, TimeToLiveSpecificationProperty, Dict[str, Any], None]) – Specifies the Time to Live (TTL) settings for the table. .. epigraph:: For detailed information about the limits in DynamoDB, see Limits in Amazon DynamoDB in the Amazon DynamoDB Developer Guide.

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters:

path (str) – The path of the value to delete.

Return type:

None

add_dependency(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters:

target (CfnResource) –

Return type:

None

add_depends_on(target)

(deprecated) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

Parameters:

target (CfnResource) –

Deprecated:

use addDependency

Stability:

deprecated

Return type:

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters:
  • key (str) –

  • value (Any) –

See:

Return type:

None

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
  "GlobalSecondaryIndexes": [
    {
      "Projection": {
        "NonKeyAttributes": [ "myattribute" ]
        ...
      }
      ...
    },
    {
      "ProjectionType": "INCLUDE"
      ...
    },
  ]
  ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters:
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type:

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters:

property_path (str) – The path to the property.

Return type:

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters:
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type:

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

Parameters:
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resource, please consult that specific resource’s documentation.

See:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options

Return type:

None

get_att(attribute_name, type_hint=None)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters:
  • attribute_name (str) – The name of the attribute.

  • type_hint (Optional[ResolutionTypeHint]) –

Return type:

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters:

key (str) –

See:

Return type:

Any

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters:

inspector (TreeInspector) – tree inspector to collect and process attributes.

Return type:

None

obtain_dependencies()

Retrieves an array of resources this resource depends on.

This assembles dependencies on resources across stacks (including nested stacks) automatically.

Return type:

List[Union[Stack, CfnResource]]

obtain_resource_dependencies()

Get a shallow copy of dependencies between this resource and other resources in the same stack.

Return type:

List[CfnResource]

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters:

new_logical_id (str) – The new logical ID to use for this stack element.

Return type:

None

remove_dependency(target)

Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

Parameters:

target (CfnResource) –

Return type:

None

replace_dependency(target, new_target)

Replaces one dependency with another.

Parameters:
Return type:

None

to_string()

Returns a string representation of this construct.

Return type:

str

Returns:

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::DynamoDB::Table'
attr_arn

The Amazon Resource Name (ARN) of the DynamoDB table, such as arn:aws:dynamodb:us-east-2:123456789012:table/myDynamoDBTable .

CloudformationAttribute:

Arn

attr_stream_arn

The ARN of the DynamoDB stream, such as arn:aws:dynamodb:us-east-1:123456789012:table/testddbstack-myDynamoDBTable-012A1SL7SMP5Q/stream/2015-11-30T20:10:00.000 .

You must specify the StreamSpecification property to use this attribute.

CloudformationAttribute:

StreamArn

attribute_definitions

A list of attributes that describe the key schema for the table and indexes.

billing_mode

Specify how you are charged for read and write throughput and how you manage capacity.

cfn_options

Options for this resource, such as condition, update policy etc.

cfn_resource_type

AWS resource type.

contributor_insights_specification

The settings used to enable or disable CloudWatch Contributor Insights for the specified table.

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

deletion_protection_enabled

Determines if a table is protected from deletion.

global_secondary_indexes

Global secondary indexes to be created on the table.

You can create up to 20 global secondary indexes.

import_source_specification

Specifies the properties of data being imported from the S3 bucket source to the table.

key_schema

Specifies the attributes that make up the primary key for the table.

kinesis_stream_specification

The Kinesis Data Streams configuration for the specified table.

local_secondary_indexes

Local secondary indexes to be created on the table.

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Returns:

the logical ID as a stringified token. This value will only get resolved during synthesis.

node

The tree node.

on_demand_throughput
point_in_time_recovery_specification

The settings used to enable point in time recovery.

provisioned_throughput

Throughput for the specified table, which consists of values for ReadCapacityUnits and WriteCapacityUnits .

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

resource_policy

A resource-based policy document that contains permissions to add to the specified table.

sse_specification

Specifies the settings to enable server-side encryption.

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

stream_specification

The settings for the DynamoDB table stream, which capture changes to items stored in the table.

table_class

The table class of the new table.

table_name

A name for the table.

tags

Tag Manager which manages the tags for this resource.

tags_raw

An array of key-value pairs to apply to this resource.

time_to_live_specification

Specifies the Time to Live (TTL) settings for the table.

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters:

x (Any) –

Return type:

bool

Returns:

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(x)

Check whether the given object is a CfnResource.

Parameters:

x (Any) –

Return type:

bool

classmethod is_construct(x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Construct.

AttributeDefinitionProperty

class CfnTable.AttributeDefinitionProperty(*, attribute_name, attribute_type)

Bases: object

Represents an attribute for describing the schema for the table and indexes.

Parameters:
  • attribute_name (str) – A name for the attribute.

  • attribute_type (str) – The data type for the attribute, where:. - S - the attribute is of type String - N - the attribute is of type Number - B - the attribute is of type Binary

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-attributedefinition.html

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

attribute_definition_property = dynamodb.CfnTable.AttributeDefinitionProperty(
    attribute_name="attributeName",
    attribute_type="attributeType"
)

Attributes

attribute_name

A name for the attribute.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-attributedefinition.html#cfn-dynamodb-table-attributedefinition-attributename

attribute_type

.

  • S - the attribute is of type String

  • N - the attribute is of type Number

  • B - the attribute is of type Binary

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-attributedefinition.html#cfn-dynamodb-table-attributedefinition-attributetype

Type:

The data type for the attribute, where

ContributorInsightsSpecificationProperty

class CfnTable.ContributorInsightsSpecificationProperty(*, enabled)

Bases: object

The settings used to enable or disable CloudWatch Contributor Insights.

Parameters:

enabled (Union[bool, IResolvable]) – Indicates whether CloudWatch Contributor Insights are to be enabled (true) or disabled (false).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-contributorinsightsspecification.html

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

contributor_insights_specification_property = dynamodb.CfnTable.ContributorInsightsSpecificationProperty(
    enabled=False
)

Attributes

enabled

Indicates whether CloudWatch Contributor Insights are to be enabled (true) or disabled (false).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-contributorinsightsspecification.html#cfn-dynamodb-table-contributorinsightsspecification-enabled

CsvProperty

class CfnTable.CsvProperty(*, delimiter=None, header_list=None)

Bases: object

The options for imported source files in CSV format.

The values are Delimiter and HeaderList.

Parameters:
  • delimiter (Optional[str]) – The delimiter used for separating items in the CSV file being imported.

  • header_list (Optional[Sequence[str]]) – List of the headers used to specify a common header for all source CSV files being imported. If this field is specified then the first line of each CSV file is treated as data instead of the header. If this field is not specified the the first line of each CSV file is treated as the header.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-csv.html

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

csv_property = dynamodb.CfnTable.CsvProperty(
    delimiter="delimiter",
    header_list=["headerList"]
)

Attributes

delimiter

The delimiter used for separating items in the CSV file being imported.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-csv.html#cfn-dynamodb-table-csv-delimiter

header_list

List of the headers used to specify a common header for all source CSV files being imported.

If this field is specified then the first line of each CSV file is treated as data instead of the header. If this field is not specified the the first line of each CSV file is treated as the header.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-csv.html#cfn-dynamodb-table-csv-headerlist

GlobalSecondaryIndexProperty

class CfnTable.GlobalSecondaryIndexProperty(*, index_name, key_schema, projection, contributor_insights_specification=None, on_demand_throughput=None, provisioned_throughput=None)

Bases: object

Represents the properties of a global secondary index.

Parameters:
  • index_name (str) – The name of the global secondary index. The name must be unique among all other indexes on this table.

  • key_schema (Union[IResolvable, Sequence[Union[IResolvable, KeySchemaProperty, Dict[str, Any]]]]) – The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and key types: - HASH - partition key - RANGE - sort key > The partition key of an item is also known as its hash attribute . The term “hash attribute” derives from DynamoDB’s usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values. .. epigraph:: The sort key of an item is also known as its range attribute . The term “range attribute” derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.

  • projection (Union[IResolvable, ProjectionProperty, Dict[str, Any]]) – Represents attributes that are copied (projected) from the table into the global secondary index. These are in addition to the primary key attributes and index key attributes, which are automatically projected.

  • contributor_insights_specification (Union[IResolvable, ContributorInsightsSpecificationProperty, Dict[str, Any], None]) – The settings used to enable or disable CloudWatch Contributor Insights for the specified global secondary index.

  • on_demand_throughput (Union[IResolvable, OnDemandThroughputProperty, Dict[str, Any], None]) –

  • provisioned_throughput (Union[IResolvable, ProvisionedThroughputProperty, Dict[str, Any], None]) – Represents the provisioned throughput settings for the specified global secondary index. For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-globalsecondaryindex.html

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

global_secondary_index_property = dynamodb.CfnTable.GlobalSecondaryIndexProperty(
    index_name="indexName",
    key_schema=[dynamodb.CfnTable.KeySchemaProperty(
        attribute_name="attributeName",
        key_type="keyType"
    )],
    projection=dynamodb.CfnTable.ProjectionProperty(
        non_key_attributes=["nonKeyAttributes"],
        projection_type="projectionType"
    ),

    # the properties below are optional
    contributor_insights_specification=dynamodb.CfnTable.ContributorInsightsSpecificationProperty(
        enabled=False
    ),
    on_demand_throughput=dynamodb.CfnTable.OnDemandThroughputProperty(
        max_read_request_units=123,
        max_write_request_units=123
    ),
    provisioned_throughput=dynamodb.CfnTable.ProvisionedThroughputProperty(
        read_capacity_units=123,
        write_capacity_units=123
    )
)

Attributes

contributor_insights_specification

The settings used to enable or disable CloudWatch Contributor Insights for the specified global secondary index.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-globalsecondaryindex.html#cfn-dynamodb-table-globalsecondaryindex-contributorinsightsspecification

index_name

The name of the global secondary index.

The name must be unique among all other indexes on this table.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-globalsecondaryindex.html#cfn-dynamodb-table-globalsecondaryindex-indexname

key_schema
  • HASH - partition key - RANGE - sort key > The partition key of an item is also known as its hash attribute .

The term “hash attribute” derives from DynamoDB’s usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values. .. epigraph:

The sort key of an item is also known as its *range attribute* . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-globalsecondaryindex.html#cfn-dynamodb-table-globalsecondaryindex-keyschema

Type:

The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and key types

on_demand_throughput

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-globalsecondaryindex.html#cfn-dynamodb-table-globalsecondaryindex-ondemandthroughput

Type:

see

projection

Represents attributes that are copied (projected) from the table into the global secondary index.

These are in addition to the primary key attributes and index key attributes, which are automatically projected.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-globalsecondaryindex.html#cfn-dynamodb-table-globalsecondaryindex-projection

provisioned_throughput

Represents the provisioned throughput settings for the specified global secondary index.

For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-globalsecondaryindex.html#cfn-dynamodb-table-globalsecondaryindex-provisionedthroughput

ImportSourceSpecificationProperty

class CfnTable.ImportSourceSpecificationProperty(*, input_format, s3_bucket_source, input_compression_type=None, input_format_options=None)

Bases: object

Specifies the properties of data being imported from the S3 bucket source to the table.

Parameters:
  • input_format (str) – The format of the source data. Valid values for ImportFormat are CSV , DYNAMODB_JSON or ION .

  • s3_bucket_source (Union[IResolvable, S3BucketSourceProperty, Dict[str, Any]]) – The S3 bucket that provides the source for the import.

  • input_compression_type (Optional[str]) – Type of compression to be used on the input coming from the imported table.

  • input_format_options (Union[IResolvable, InputFormatOptionsProperty, Dict[str, Any], None]) – Additional properties that specify how the input is formatted,.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-importsourcespecification.html

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

import_source_specification_property = dynamodb.CfnTable.ImportSourceSpecificationProperty(
    input_format="inputFormat",
    s3_bucket_source=dynamodb.CfnTable.S3BucketSourceProperty(
        s3_bucket="s3Bucket",

        # the properties below are optional
        s3_bucket_owner="s3BucketOwner",
        s3_key_prefix="s3KeyPrefix"
    ),

    # the properties below are optional
    input_compression_type="inputCompressionType",
    input_format_options=dynamodb.CfnTable.InputFormatOptionsProperty(
        csv=dynamodb.CfnTable.CsvProperty(
            delimiter="delimiter",
            header_list=["headerList"]
        )
    )
)

Attributes

input_compression_type

Type of compression to be used on the input coming from the imported table.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-importsourcespecification.html#cfn-dynamodb-table-importsourcespecification-inputcompressiontype

input_format

The format of the source data.

Valid values for ImportFormat are CSV , DYNAMODB_JSON or ION .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-importsourcespecification.html#cfn-dynamodb-table-importsourcespecification-inputformat

input_format_options

Additional properties that specify how the input is formatted,.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-importsourcespecification.html#cfn-dynamodb-table-importsourcespecification-inputformatoptions

s3_bucket_source

The S3 bucket that provides the source for the import.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-importsourcespecification.html#cfn-dynamodb-table-importsourcespecification-s3bucketsource

InputFormatOptionsProperty

class CfnTable.InputFormatOptionsProperty(*, csv=None)

Bases: object

The format options for the data that was imported into the target table.

There is one value, CsvOption.

Parameters:

csv (Union[IResolvable, CsvProperty, Dict[str, Any], None]) – The options for imported source files in CSV format. The values are Delimiter and HeaderList.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-inputformatoptions.html

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

input_format_options_property = dynamodb.CfnTable.InputFormatOptionsProperty(
    csv=dynamodb.CfnTable.CsvProperty(
        delimiter="delimiter",
        header_list=["headerList"]
    )
)

Attributes

csv

The options for imported source files in CSV format.

The values are Delimiter and HeaderList.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-inputformatoptions.html#cfn-dynamodb-table-inputformatoptions-csv

KeySchemaProperty

class CfnTable.KeySchemaProperty(*, attribute_name, key_type)

Bases: object

Represents a single element of a key schema.

A key schema specifies the attributes that make up the primary key of a table, or the key attributes of an index.

A KeySchemaElement represents exactly one attribute of the primary key. For example, a simple primary key would be represented by one KeySchemaElement (for the partition key). A composite primary key would require one KeySchemaElement for the partition key, and another KeySchemaElement for the sort key.

A KeySchemaElement must be a scalar, top-level attribute (not a nested attribute). The data type must be one of String, Number, or Binary. The attribute cannot be nested within a List or a Map.

Parameters:
  • attribute_name (str) – The name of a key attribute.

  • key_type (str) – The role that this key attribute will assume:. - HASH - partition key - RANGE - sort key .. epigraph:: The partition key of an item is also known as its hash attribute . The term “hash attribute” derives from DynamoDB’s usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values. The sort key of an item is also known as its range attribute . The term “range attribute” derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-keyschema.html

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

key_schema_property = dynamodb.CfnTable.KeySchemaProperty(
    attribute_name="attributeName",
    key_type="keyType"
)

Attributes

attribute_name

The name of a key attribute.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-keyschema.html#cfn-dynamodb-table-keyschema-attributename

key_type

.

  • HASH - partition key

  • RANGE - sort key

The partition key of an item is also known as its hash attribute . The term “hash attribute” derives from DynamoDB’s usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.

The sort key of an item is also known as its range attribute . The term “range attribute” derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-keyschema.html#cfn-dynamodb-table-keyschema-keytype

Type:

The role that this key attribute will assume

KinesisStreamSpecificationProperty

class CfnTable.KinesisStreamSpecificationProperty(*, stream_arn, approximate_creation_date_time_precision=None)

Bases: object

The Kinesis Data Streams configuration for the specified table.

Parameters:
  • stream_arn (str) – The ARN for a specific Kinesis data stream. Length Constraints: Minimum length of 37. Maximum length of 1024.

  • approximate_creation_date_time_precision (Optional[str]) – The precision for the time and date that the stream was created.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-kinesisstreamspecification.html

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

kinesis_stream_specification_property = dynamodb.CfnTable.KinesisStreamSpecificationProperty(
    stream_arn="streamArn",

    # the properties below are optional
    approximate_creation_date_time_precision="approximateCreationDateTimePrecision"
)

Attributes

approximate_creation_date_time_precision

The precision for the time and date that the stream was created.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-kinesisstreamspecification.html#cfn-dynamodb-table-kinesisstreamspecification-approximatecreationdatetimeprecision

stream_arn

The ARN for a specific Kinesis data stream.

Length Constraints: Minimum length of 37. Maximum length of 1024.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-kinesisstreamspecification.html#cfn-dynamodb-table-kinesisstreamspecification-streamarn

LocalSecondaryIndexProperty

class CfnTable.LocalSecondaryIndexProperty(*, index_name, key_schema, projection)

Bases: object

Represents the properties of a local secondary index.

A local secondary index can only be created when its parent table is created.

Parameters:
  • index_name (str) – The name of the local secondary index. The name must be unique among all other indexes on this table.

  • key_schema (Union[IResolvable, Sequence[Union[IResolvable, KeySchemaProperty, Dict[str, Any]]]]) – The complete key schema for the local secondary index, consisting of one or more pairs of attribute names and key types: - HASH - partition key - RANGE - sort key > The partition key of an item is also known as its hash attribute . The term “hash attribute” derives from DynamoDB’s usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values. .. epigraph:: The sort key of an item is also known as its range attribute . The term “range attribute” derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.

  • projection (Union[IResolvable, ProjectionProperty, Dict[str, Any]]) – Represents attributes that are copied (projected) from the table into the local secondary index. These are in addition to the primary key attributes and index key attributes, which are automatically projected.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-localsecondaryindex.html

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

local_secondary_index_property = dynamodb.CfnTable.LocalSecondaryIndexProperty(
    index_name="indexName",
    key_schema=[dynamodb.CfnTable.KeySchemaProperty(
        attribute_name="attributeName",
        key_type="keyType"
    )],
    projection=dynamodb.CfnTable.ProjectionProperty(
        non_key_attributes=["nonKeyAttributes"],
        projection_type="projectionType"
    )
)

Attributes

index_name

The name of the local secondary index.

The name must be unique among all other indexes on this table.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-localsecondaryindex.html#cfn-dynamodb-table-localsecondaryindex-indexname

key_schema
  • HASH - partition key - RANGE - sort key > The partition key of an item is also known as its hash attribute .

The term “hash attribute” derives from DynamoDB’s usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values. .. epigraph:

The sort key of an item is also known as its *range attribute* . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-localsecondaryindex.html#cfn-dynamodb-table-localsecondaryindex-keyschema

Type:

The complete key schema for the local secondary index, consisting of one or more pairs of attribute names and key types

projection

Represents attributes that are copied (projected) from the table into the local secondary index.

These are in addition to the primary key attributes and index key attributes, which are automatically projected.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-localsecondaryindex.html#cfn-dynamodb-table-localsecondaryindex-projection

OnDemandThroughputProperty

class CfnTable.OnDemandThroughputProperty(*, max_read_request_units=None, max_write_request_units=None)

Bases: object

Parameters:
  • max_read_request_units (Union[int, float, None]) –

  • max_write_request_units (Union[int, float, None]) –

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ondemandthroughput.html

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

on_demand_throughput_property = dynamodb.CfnTable.OnDemandThroughputProperty(
    max_read_request_units=123,
    max_write_request_units=123
)

Attributes

max_read_request_units

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ondemandthroughput.html#cfn-dynamodb-table-ondemandthroughput-maxreadrequestunits

Type:

see

max_write_request_units

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ondemandthroughput.html#cfn-dynamodb-table-ondemandthroughput-maxwriterequestunits

Type:

see

PointInTimeRecoverySpecificationProperty

class CfnTable.PointInTimeRecoverySpecificationProperty(*, point_in_time_recovery_enabled=None)

Bases: object

The settings used to enable point in time recovery.

Parameters:

point_in_time_recovery_enabled (Union[bool, IResolvable, None]) – Indicates whether point in time recovery is enabled (true) or disabled (false) on the table.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-pointintimerecoveryspecification.html

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

point_in_time_recovery_specification_property = dynamodb.CfnTable.PointInTimeRecoverySpecificationProperty(
    point_in_time_recovery_enabled=False
)

Attributes

point_in_time_recovery_enabled

Indicates whether point in time recovery is enabled (true) or disabled (false) on the table.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-pointintimerecoveryspecification.html#cfn-dynamodb-table-pointintimerecoveryspecification-pointintimerecoveryenabled

ProjectionProperty

class CfnTable.ProjectionProperty(*, non_key_attributes=None, projection_type=None)

Bases: object

Represents attributes that are copied (projected) from the table into an index.

These are in addition to the primary key attributes and index key attributes, which are automatically projected.

Parameters:
  • non_key_attributes (Optional[Sequence[str]]) – Represents the non-key attribute names which will be projected into the index. For local secondary indexes, the total count of NonKeyAttributes summed across all of the local secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.

  • projection_type (Optional[str]) – The set of attributes that are projected into the index:. - KEYS_ONLY - Only the index and primary keys are projected into the index. - INCLUDE - In addition to the attributes described in KEYS_ONLY , the secondary index will include other non-key attributes that you specify. - ALL - All of the table attributes are projected into the index. When using the DynamoDB console, ALL is selected by default.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-projection.html

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

projection_property = dynamodb.CfnTable.ProjectionProperty(
    non_key_attributes=["nonKeyAttributes"],
    projection_type="projectionType"
)

Attributes

non_key_attributes

Represents the non-key attribute names which will be projected into the index.

For local secondary indexes, the total count of NonKeyAttributes summed across all of the local secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-projection.html#cfn-dynamodb-table-projection-nonkeyattributes

projection_type

.

  • KEYS_ONLY - Only the index and primary keys are projected into the index.

  • INCLUDE - In addition to the attributes described in KEYS_ONLY , the secondary index will include other non-key attributes that you specify.

  • ALL - All of the table attributes are projected into the index.

When using the DynamoDB console, ALL is selected by default.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-projection.html#cfn-dynamodb-table-projection-projectiontype

Type:

The set of attributes that are projected into the index

ProvisionedThroughputProperty

class CfnTable.ProvisionedThroughputProperty(*, read_capacity_units, write_capacity_units)

Bases: object

Throughput for the specified table, which consists of values for ReadCapacityUnits and WriteCapacityUnits .

For more information about the contents of a provisioned throughput structure, see Amazon DynamoDB Table ProvisionedThroughput .

Parameters:
  • read_capacity_units (Union[int, float]) – The maximum number of strongly consistent reads consumed per second before DynamoDB returns a ThrottlingException . For more information, see Specifying Read and Write Requirements in the Amazon DynamoDB Developer Guide . If read/write capacity mode is PAY_PER_REQUEST the value is set to 0.

  • write_capacity_units (Union[int, float]) –

    The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException . For more information, see Specifying Read and Write Requirements in the Amazon DynamoDB Developer Guide . If read/write capacity mode is PAY_PER_REQUEST the value is set to 0.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-provisionedthroughput.html

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

provisioned_throughput_property = dynamodb.CfnTable.ProvisionedThroughputProperty(
    read_capacity_units=123,
    write_capacity_units=123
)

Attributes

read_capacity_units

The maximum number of strongly consistent reads consumed per second before DynamoDB returns a ThrottlingException .

For more information, see Specifying Read and Write Requirements in the Amazon DynamoDB Developer Guide .

If read/write capacity mode is PAY_PER_REQUEST the value is set to 0.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-provisionedthroughput.html#cfn-dynamodb-table-provisionedthroughput-readcapacityunits

write_capacity_units

The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException .

For more information, see Specifying Read and Write Requirements in the Amazon DynamoDB Developer Guide .

If read/write capacity mode is PAY_PER_REQUEST the value is set to 0.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-provisionedthroughput.html#cfn-dynamodb-table-provisionedthroughput-writecapacityunits

ResourcePolicyProperty

class CfnTable.ResourcePolicyProperty(*, policy_document)

Bases: object

Creates or updates a resource-based policy document that contains the permissions for DynamoDB resources, such as a table, its indexes, and stream.

Resource-based policies let you define access permissions by specifying who has access to each resource, and the actions they are allowed to perform on each resource.

In a CloudFormation template, you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to DynamoDB . For more information about resource-based policies, see Using resource-based policies for DynamoDB and Resource-based policy examples .

While defining resource-based policies in your CloudFormation templates, the following considerations apply:

  • The maximum size supported for a resource-based policy document in JSON format is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit.

  • Resource-based policies don’t support drift detection . If you update a policy outside of the CloudFormation stack template, you’ll need to update the CloudFormation stack with the changes.

  • Resource-based policies don’t support out-of-band changes. If you add, update, or delete a policy outside of the CloudFormation template, the change won’t be overwritten if there are no changes to the policy within the template.

For example, say that your template contains a resource-based policy, which you later update outside of the template. If you don’t make any changes to the policy in the template, the updated policy in DynamoDB won’t be synced with the policy in the template.

Conversely, say that your template doesn’t contain a resource-based policy, but you add a policy outside of the template. This policy won’t be removed from DynamoDB as long as you don’t add it to the template. When you add a policy to the template and update the stack, the existing policy in DynamoDB will be updated to match the one defined in the template.

For a full list of all considerations, see Resource-based policy considerations .

Parameters:

policy_document (Any) –

A resource-based policy document that contains permissions to add to the specified DynamoDB table, index, or both. In a CloudFormation template, you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to DynamoDB . For more information about resource-based policies, see Using resource-based policies for DynamoDB and Resource-based policy examples .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-resourcepolicy.html

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

# policy_document: Any

resource_policy_property = dynamodb.CfnTable.ResourcePolicyProperty(
    policy_document=policy_document
)

Attributes

policy_document

A resource-based policy document that contains permissions to add to the specified DynamoDB table, index, or both.

In a CloudFormation template, you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to DynamoDB . For more information about resource-based policies, see Using resource-based policies for DynamoDB and Resource-based policy examples .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-resourcepolicy.html#cfn-dynamodb-table-resourcepolicy-policydocument

S3BucketSourceProperty

class CfnTable.S3BucketSourceProperty(*, s3_bucket, s3_bucket_owner=None, s3_key_prefix=None)

Bases: object

The S3 bucket that is being imported from.

Parameters:
  • s3_bucket (str) – The S3 bucket that is being imported from.

  • s3_bucket_owner (Optional[str]) – The account number of the S3 bucket that is being imported from. If the bucket is owned by the requester this is optional.

  • s3_key_prefix (Optional[str]) – The key prefix shared by all S3 Objects that are being imported.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-s3bucketsource.html

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

s3_bucket_source_property = dynamodb.CfnTable.S3BucketSourceProperty(
    s3_bucket="s3Bucket",

    # the properties below are optional
    s3_bucket_owner="s3BucketOwner",
    s3_key_prefix="s3KeyPrefix"
)

Attributes

s3_bucket

The S3 bucket that is being imported from.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-s3bucketsource.html#cfn-dynamodb-table-s3bucketsource-s3bucket

s3_bucket_owner

The account number of the S3 bucket that is being imported from.

If the bucket is owned by the requester this is optional.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-s3bucketsource.html#cfn-dynamodb-table-s3bucketsource-s3bucketowner

s3_key_prefix

The key prefix shared by all S3 Objects that are being imported.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-s3bucketsource.html#cfn-dynamodb-table-s3bucketsource-s3keyprefix

SSESpecificationProperty

class CfnTable.SSESpecificationProperty(*, sse_enabled, kms_master_key_id=None, sse_type=None)

Bases: object

Represents the settings used to enable server-side encryption.

Parameters:
  • sse_enabled (Union[bool, IResolvable]) – Indicates whether server-side encryption is done using an AWS managed key or an AWS owned key. If enabled (true), server-side encryption type is set to KMS and an AWS managed key is used ( AWS KMS charges apply). If disabled (false) or not specified, server-side encryption is set to AWS owned key.

  • kms_master_key_id (Optional[str]) – The AWS KMS key that should be used for the AWS KMS encryption. To specify a key, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. Note that you should only provide this parameter if the key is different from the default DynamoDB key alias/aws/dynamodb .

  • sse_type (Optional[str]) – Server-side encryption type. The only supported value is:. - KMS - Server-side encryption that uses AWS Key Management Service . The key is stored in your account and is managed by AWS KMS ( AWS KMS charges apply).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ssespecification.html

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

s_sESpecification_property = dynamodb.CfnTable.SSESpecificationProperty(
    sse_enabled=False,

    # the properties below are optional
    kms_master_key_id="kmsMasterKeyId",
    sse_type="sseType"
)

Attributes

kms_master_key_id

The AWS KMS key that should be used for the AWS KMS encryption.

To specify a key, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. Note that you should only provide this parameter if the key is different from the default DynamoDB key alias/aws/dynamodb .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ssespecification.html#cfn-dynamodb-table-ssespecification-kmsmasterkeyid

sse_enabled

Indicates whether server-side encryption is done using an AWS managed key or an AWS owned key.

If enabled (true), server-side encryption type is set to KMS and an AWS managed key is used ( AWS KMS charges apply). If disabled (false) or not specified, server-side encryption is set to AWS owned key.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ssespecification.html#cfn-dynamodb-table-ssespecification-sseenabled

sse_type

.

  • KMS - Server-side encryption that uses AWS Key Management Service . The key is stored in your account and is managed by AWS KMS ( AWS KMS charges apply).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ssespecification.html#cfn-dynamodb-table-ssespecification-ssetype

Type:

Server-side encryption type. The only supported value is

StreamSpecificationProperty

class CfnTable.StreamSpecificationProperty(*, stream_view_type, resource_policy=None)

Bases: object

Represents the DynamoDB Streams configuration for a table in DynamoDB.

Parameters:
  • stream_view_type (str) – When an item in the table is modified, StreamViewType determines what information is written to the stream for this table. Valid values for StreamViewType are: - KEYS_ONLY - Only the key attributes of the modified item are written to the stream. - NEW_IMAGE - The entire item, as it appears after it was modified, is written to the stream. - OLD_IMAGE - The entire item, as it appeared before it was modified, is written to the stream. - NEW_AND_OLD_IMAGES - Both the new and the old item images of the item are written to the stream.

  • resource_policy (Union[IResolvable, ResourcePolicyProperty, Dict[str, Any], None]) –

    Creates or updates a resource-based policy document that contains the permissions for DynamoDB resources, such as a table’s streams. Resource-based policies let you define access permissions by specifying who has access to each resource, and the actions they are allowed to perform on each resource. In a CloudFormation template, you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to DynamoDB . For more information about resource-based policies, see Using resource-based policies for DynamoDB and Resource-based policy examples .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-streamspecification.html

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

# policy_document: Any

stream_specification_property = dynamodb.CfnTable.StreamSpecificationProperty(
    stream_view_type="streamViewType",

    # the properties below are optional
    resource_policy=dynamodb.CfnTable.ResourcePolicyProperty(
        policy_document=policy_document
    )
)

Attributes

resource_policy

Creates or updates a resource-based policy document that contains the permissions for DynamoDB resources, such as a table’s streams.

Resource-based policies let you define access permissions by specifying who has access to each resource, and the actions they are allowed to perform on each resource.

In a CloudFormation template, you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to DynamoDB . For more information about resource-based policies, see Using resource-based policies for DynamoDB and Resource-based policy examples .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-streamspecification.html#cfn-dynamodb-table-streamspecification-resourcepolicy

stream_view_type

When an item in the table is modified, StreamViewType determines what information is written to the stream for this table.

Valid values for StreamViewType are:

  • KEYS_ONLY - Only the key attributes of the modified item are written to the stream.

  • NEW_IMAGE - The entire item, as it appears after it was modified, is written to the stream.

  • OLD_IMAGE - The entire item, as it appeared before it was modified, is written to the stream.

  • NEW_AND_OLD_IMAGES - Both the new and the old item images of the item are written to the stream.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-streamspecification.html#cfn-dynamodb-table-streamspecification-streamviewtype

TimeToLiveSpecificationProperty

class CfnTable.TimeToLiveSpecificationProperty(*, enabled, attribute_name=None)

Bases: object

Represents the settings used to enable or disable Time to Live (TTL) for the specified table.

Parameters:
  • enabled (Union[bool, IResolvable]) – Indicates whether TTL is to be enabled (true) or disabled (false) on the table.

  • attribute_name (Optional[str]) – The name of the TTL attribute used to store the expiration time for items in the table. .. epigraph:: - The AttributeName property is required when enabling the TTL, or when TTL is already enabled. - To update this property, you must first disable TTL and then enable TTL with the new attribute name.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-timetolivespecification.html

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

time_to_live_specification_property = dynamodb.CfnTable.TimeToLiveSpecificationProperty(
    enabled=False,

    # the properties below are optional
    attribute_name="attributeName"
)

Attributes

attribute_name

The name of the TTL attribute used to store the expiration time for items in the table.

  • The AttributeName property is required when enabling the TTL, or when TTL is already enabled.

  • To update this property, you must first disable TTL and then enable TTL with the new attribute name.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-timetolivespecification.html#cfn-dynamodb-table-timetolivespecification-attributename

enabled

Indicates whether TTL is to be enabled (true) or disabled (false) on the table.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-timetolivespecification.html#cfn-dynamodb-table-timetolivespecification-enabled