Class CfnTable
The AWS::DynamoDB::Table
resource creates a DynamoDB table. For more information, see CreateTable in the Amazon DynamoDB API Reference .
Inherited Members
Namespace: Amazon.CDK.AWS.DynamoDB
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnTable : CfnResource, IInspectable, ITaggable
Syntax (vb)
Public Class CfnTable
Inherits CfnResource
Implements IInspectable, ITaggable
Remarks
You should be aware of the following behaviors when working with DynamoDB tables:
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
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 cfnTable = new CfnTable(this, "MyCfnTable", 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
},
OnDemandThroughput = new OnDemandThroughputProperty {
MaxReadRequestUnits = 123,
MaxWriteRequestUnits = 123
},
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"
}
} },
OnDemandThroughput = new OnDemandThroughputProperty {
MaxReadRequestUnits = 123,
MaxWriteRequestUnits = 123
},
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
CfnTable(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnTable(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnTable(Construct, String, ICfnTableProps) |
Properties
AttrArn | The Amazon Resource Name (ARN) of the DynamoDB table, such as |
AttributeDefinitions | A list of attributes that describe the key schema for the table and indexes. |
AttrStreamArn | The ARN of the DynamoDB stream, such as |
BillingMode | Specify how you are charged for read and write throughput and how you manage capacity. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
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. |
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. |
OnDemandThroughput | Sets the maximum number of read and write units for the specified on-demand 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 | Tag Manager which manages the tags for this resource. |
TagsRaw | An array of key-value pairs to apply to this resource. |
TimeToLiveSpecification | Specifies the Time to Live (TTL) settings for the table. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnTable(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnTable(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnTable(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnTable(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnTable(Construct, String, ICfnTableProps)
public CfnTable(Construct scope, string id, ICfnTableProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnTableProps
Resource properties.
Properties
AttrArn
The Amazon Resource Name (ARN) of the DynamoDB table, such as arn:aws:dynamodb:us-east-2:123456789012:table/myDynamoDBTable
.
public virtual string AttrArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Arn
AttributeDefinitions
A list of attributes that describe the key schema for the table and indexes.
public virtual object AttributeDefinitions { get; set; }
Property Value
System.Object
AttrStreamArn
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
.
public virtual string AttrStreamArn { get; }
Property Value
System.String
Remarks
You must specify the StreamSpecification
property to use this attribute.
CloudformationAttribute: StreamArn
BillingMode
Specify how you are charged for read and write throughput and how you manage capacity.
public virtual string BillingMode { get; set; }
Property Value
System.String
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
ContributorInsightsSpecification
The settings used to enable or disable CloudWatch Contributor Insights for the specified table.
public virtual object ContributorInsightsSpecification { get; set; }
Property Value
System.Object
DeletionProtectionEnabled
Determines if a table is protected from deletion.
public virtual object DeletionProtectionEnabled { get; set; }
Property Value
System.Object
GlobalSecondaryIndexes
Global secondary indexes to be created on the table.
public virtual object GlobalSecondaryIndexes { get; set; }
Property Value
System.Object
Remarks
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.
public virtual object ImportSourceSpecification { get; set; }
Property Value
System.Object
KeySchema
Specifies the attributes that make up the primary key for the table.
public virtual object KeySchema { get; set; }
Property Value
System.Object
KinesisStreamSpecification
The Kinesis Data Streams configuration for the specified table.
public virtual object KinesisStreamSpecification { get; set; }
Property Value
System.Object
LocalSecondaryIndexes
Local secondary indexes to be created on the table.
public virtual object LocalSecondaryIndexes { get; set; }
Property Value
System.Object
OnDemandThroughput
Sets the maximum number of read and write units for the specified on-demand table.
public virtual object OnDemandThroughput { get; set; }
Property Value
System.Object
PointInTimeRecoverySpecification
The settings used to enable point in time recovery.
public virtual object PointInTimeRecoverySpecification { get; set; }
Property Value
System.Object
ProvisionedThroughput
Throughput for the specified table, which consists of values for ReadCapacityUnits
and WriteCapacityUnits
.
public virtual object ProvisionedThroughput { get; set; }
Property Value
System.Object
ResourcePolicy
A resource-based policy document that contains permissions to add to the specified table.
public virtual object ResourcePolicy { get; set; }
Property Value
System.Object
SseSpecification
Specifies the settings to enable server-side encryption.
public virtual object SseSpecification { get; set; }
Property Value
System.Object
StreamSpecification
The settings for the DynamoDB table stream, which capture changes to items stored in the table.
public virtual object StreamSpecification { get; set; }
Property Value
System.Object
TableClass
The table class of the new table.
public virtual string TableClass { get; set; }
Property Value
System.String
TableName
A name for the table.
public virtual string TableName { get; set; }
Property Value
System.String
Tags
Tag Manager which manages the tags for this resource.
public virtual TagManager Tags { get; }
Property Value
TagsRaw
An array of key-value pairs to apply to this resource.
public virtual ICfnTag[] TagsRaw { get; set; }
Property Value
ICfnTag[]
TimeToLiveSpecification
Specifies the Time to Live (TTL) settings for the table.
public virtual object TimeToLiveSpecification { get; set; }
Property Value
System.Object
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>