Class CfnTableProps
Properties for defining a CfnTable
.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.DynamoDB
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnTableProps : Object, ICfnTableProps
Syntax (vb)
Public Class CfnTableProps
Inherits Object
Implements ICfnTableProps
Remarks
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.DynamoDB;
var policyDocument;
var cfnTableProps = new CfnTableProps {
KeySchema = new [] { new KeySchemaProperty {
AttributeName = "attributeName",
KeyType = "keyType"
} },
// the properties below are optional
AttributeDefinitions = new [] { new AttributeDefinitionProperty {
AttributeName = "attributeName",
AttributeType = "attributeType"
} },
BillingMode = "billingMode",
ContributorInsightsSpecification = new ContributorInsightsSpecificationProperty {
Enabled = false
},
DeletionProtectionEnabled = false,
GlobalSecondaryIndexes = new [] { new GlobalSecondaryIndexProperty {
IndexName = "indexName",
KeySchema = new [] { new KeySchemaProperty {
AttributeName = "attributeName",
KeyType = "keyType"
} },
Projection = new ProjectionProperty {
NonKeyAttributes = new [] { "nonKeyAttributes" },
ProjectionType = "projectionType"
},
// the properties below are optional
ContributorInsightsSpecification = new ContributorInsightsSpecificationProperty {
Enabled = false
},
ProvisionedThroughput = new ProvisionedThroughputProperty {
ReadCapacityUnits = 123,
WriteCapacityUnits = 123
}
} },
ImportSourceSpecification = new ImportSourceSpecificationProperty {
InputFormat = "inputFormat",
S3BucketSource = new S3BucketSourceProperty {
S3Bucket = "s3Bucket",
// the properties below are optional
S3BucketOwner = "s3BucketOwner",
S3KeyPrefix = "s3KeyPrefix"
},
// the properties below are optional
InputCompressionType = "inputCompressionType",
InputFormatOptions = new InputFormatOptionsProperty {
Csv = new CsvProperty {
Delimiter = "delimiter",
HeaderList = new [] { "headerList" }
}
}
},
KinesisStreamSpecification = new KinesisStreamSpecificationProperty {
StreamArn = "streamArn",
// the properties below are optional
ApproximateCreationDateTimePrecision = "approximateCreationDateTimePrecision"
},
LocalSecondaryIndexes = new [] { new LocalSecondaryIndexProperty {
IndexName = "indexName",
KeySchema = new [] { new KeySchemaProperty {
AttributeName = "attributeName",
KeyType = "keyType"
} },
Projection = new ProjectionProperty {
NonKeyAttributes = new [] { "nonKeyAttributes" },
ProjectionType = "projectionType"
}
} },
PointInTimeRecoverySpecification = new PointInTimeRecoverySpecificationProperty {
PointInTimeRecoveryEnabled = false
},
ProvisionedThroughput = new ProvisionedThroughputProperty {
ReadCapacityUnits = 123,
WriteCapacityUnits = 123
},
ResourcePolicy = new ResourcePolicyProperty {
PolicyDocument = policyDocument
},
SseSpecification = new SSESpecificationProperty {
SseEnabled = false,
// the properties below are optional
KmsMasterKeyId = "kmsMasterKeyId",
SseType = "sseType"
},
StreamSpecification = new StreamSpecificationProperty {
StreamViewType = "streamViewType",
// the properties below are optional
ResourcePolicy = new ResourcePolicyProperty {
PolicyDocument = policyDocument
}
},
TableClass = "tableClass",
TableName = "tableName",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
TimeToLiveSpecification = new TimeToLiveSpecificationProperty {
Enabled = false,
// the properties below are optional
AttributeName = "attributeName"
}
};
Synopsis
Constructors
CfnTableProps() |
Properties
AttributeDefinitions | A list of attributes that describe the key schema for the table and indexes. |
BillingMode | Specify how you are charged for read and write throughput and how you manage capacity. |
ContributorInsightsSpecification | The settings used to enable or disable CloudWatch Contributor Insights for the specified table. |
DeletionProtectionEnabled | Determines if a table is protected from deletion. |
GlobalSecondaryIndexes | Global secondary indexes to be created on the table. You can create up to 20 global secondary indexes. |
ImportSourceSpecification | Specifies the properties of data being imported from the S3 bucket source to the table. |
KeySchema | Specifies the attributes that make up the primary key for the table. |
KinesisStreamSpecification | The Kinesis Data Streams configuration for the specified table. |
LocalSecondaryIndexes | Local secondary indexes to be created on the table. |
PointInTimeRecoverySpecification | The settings used to enable point in time recovery. |
ProvisionedThroughput | Throughput for the specified table, which consists of values for |
ResourcePolicy | A resource-based policy document that contains permissions to add to the specified table. |
SseSpecification | Specifies the settings to enable server-side encryption. |
StreamSpecification | The settings for the DynamoDB table stream, which capture changes to items stored in the table. |
TableClass | The table class of the new table. |
TableName | A name for the table. |
Tags | An array of key-value pairs to apply to this resource. |
TimeToLiveSpecification | Specifies the Time to Live (TTL) settings for the table. |
Constructors
CfnTableProps()
public CfnTableProps()
Properties
AttributeDefinitions
A list of attributes that describe the key schema for the table and indexes.
public object AttributeDefinitions { get; set; }
Property Value
System.Object
Remarks
This property is required to create a DynamoDB table.
Update requires: Some interruptions . Replacement if you edit an existing AttributeDefinition.
BillingMode
Specify how you are charged for read and write throughput and how you manage capacity.
public string BillingMode { get; set; }
Property Value
System.String
Remarks
Valid values include:
If not specified, the default is PROVISIONED
.
ContributorInsightsSpecification
The settings used to enable or disable CloudWatch Contributor Insights for the specified table.
public object ContributorInsightsSpecification { get; set; }
Property Value
System.Object
Remarks
DeletionProtectionEnabled
Determines if a table is protected from deletion.
public object DeletionProtectionEnabled { get; set; }
Property Value
System.Object
Remarks
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 .
GlobalSecondaryIndexes
Global secondary indexes to be created on the table. You can create up to 20 global secondary indexes.
public object GlobalSecondaryIndexes { get; set; }
Property Value
System.Object
Remarks
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:
ImportSourceSpecification
Specifies the properties of data being imported from the S3 bucket source to the table.
public object ImportSourceSpecification { get; set; }
Property Value
System.Object
Remarks
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.
KeySchema
Specifies the attributes that make up the primary key for the table.
public object KeySchema { get; set; }
Property Value
System.Object
Remarks
The attributes in the KeySchema
property must also be defined in the AttributeDefinitions
property.
KinesisStreamSpecification
The Kinesis Data Streams configuration for the specified table.
public object KinesisStreamSpecification { get; set; }
Property Value
System.Object
Remarks
LocalSecondaryIndexes
Local secondary indexes to be created on the table.
public object LocalSecondaryIndexes { get; set; }
Property Value
System.Object
Remarks
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.
PointInTimeRecoverySpecification
The settings used to enable point in time recovery.
public object PointInTimeRecoverySpecification { get; set; }
Property Value
System.Object
Remarks
ProvisionedThroughput
Throughput for the specified table, which consists of values for ReadCapacityUnits
and WriteCapacityUnits
.
public object ProvisionedThroughput { get; set; }
Property Value
System.Object
Remarks
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.
ResourcePolicy
A resource-based policy document that contains permissions to add to the specified table.
public object ResourcePolicy { get; set; }
Property Value
System.Object
Remarks
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 .
SseSpecification
Specifies the settings to enable server-side encryption.
public object SseSpecification { get; set; }
Property Value
System.Object
Remarks
StreamSpecification
The settings for the DynamoDB table stream, which capture changes to items stored in the table.
public object StreamSpecification { get; set; }
Property Value
System.Object
Remarks
TableClass
The table class of the new table.
public string TableClass { get; set; }
Property Value
System.String
Remarks
Valid values are STANDARD
and STANDARD_INFREQUENT_ACCESS
.
TableName
A name for the table.
public string TableName { get; set; }
Property Value
System.String
Remarks
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 .
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
An array of key-value pairs to apply to this resource.
public ICfnTag[] Tags { get; set; }
Property Value
ICfnTag[]
Remarks
For more information, see Tag .
TimeToLiveSpecification
Specifies the Time to Live (TTL) settings for the table.
public object TimeToLiveSpecification { get; set; }
Property Value
System.Object
Remarks
For detailed information about the limits in DynamoDB, see Limits in Amazon DynamoDB in the Amazon DynamoDB Developer Guide.