CfnTableProps Struct
Properties for defining a CfnTable.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_timestream as timestream } from 'aws-cdk-lib';
declare const magneticStoreWriteProperties: any;
declare const retentionProperties: any;
const cfnTableProps: timestream.CfnTableProps = {
databaseName: 'databaseName',
// the properties below are optional
magneticStoreWriteProperties: magneticStoreWriteProperties,
retentionProperties: retentionProperties,
schema: {
compositePartitionKey: [{
type: 'type',
// the properties below are optional
enforcementInRecord: 'enforcementInRecord',
name: 'name',
}],
},
tableName: 'tableName',
tags: [{
key: 'key',
value: 'value',
}],
};
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_timestream as timestream
# magnetic_store_write_properties: Any
# retention_properties: Any
cfn_table_props = timestream.CfnTableProps(
database_name="databaseName",
# the properties below are optional
magnetic_store_write_properties=magnetic_store_write_properties,
retention_properties=retention_properties,
schema=timestream.CfnTable.SchemaProperty(
composite_partition_key=[timestream.CfnTable.PartitionKeyProperty(
type="type",
# the properties below are optional
enforcement_in_record="enforcementInRecord",
name="name"
)]
),
table_name="tableName",
tags=[CfnTag(
key="key",
value="value"
)]
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.timestream.*;
Object magneticStoreWriteProperties;
Object retentionProperties;
CfnTableProps cfnTableProps = CfnTableProps.builder()
.databaseName("databaseName")
// the properties below are optional
.magneticStoreWriteProperties(magneticStoreWriteProperties)
.retentionProperties(retentionProperties)
.schema(SchemaProperty.builder()
.compositePartitionKey(List.of(PartitionKeyProperty.builder()
.type("type")
// the properties below are optional
.enforcementInRecord("enforcementInRecord")
.name("name")
.build()))
.build())
.tableName("tableName")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Timestream;
var magneticStoreWriteProperties;
var retentionProperties;
var cfnTableProps = new CfnTableProps {
DatabaseName = "databaseName",
// the properties below are optional
MagneticStoreWriteProperties = magneticStoreWriteProperties,
RetentionProperties = retentionProperties,
Schema = new SchemaProperty {
CompositePartitionKey = new [] { new PartitionKeyProperty {
Type = "type",
// the properties below are optional
EnforcementInRecord = "enforcementInRecord",
Name = "name"
} }
},
TableName = "tableName",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
var magneticStoreWriteProperties interface{}
var retentionProperties interface{}
cfnTableProps := &CfnTableProps{
DatabaseName: jsii.String("databaseName"),
// the properties below are optional
MagneticStoreWriteProperties: magneticStoreWriteProperties,
RetentionProperties: retentionProperties,
Schema: &SchemaProperty{
CompositePartitionKey: []interface{}{
&PartitionKeyProperty{
Type: jsii.String("type"),
// the properties below are optional
EnforcementInRecord: jsii.String("enforcementInRecord"),
Name: jsii.String("name"),
},
},
},
TableName: jsii.String("tableName"),
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
}
Properties
databaseNamestring | IDatabaseRefdatabase_nametyping.Union[str, IDatabaseRef]databaseNameStringDatabaseNamestringDatabaseNameinterface{}required#Length Constraints : Minimum length of 3 bytes. Maximum length of 256 bytes.
magneticStoreWritePropertiesoptionalanymagnetic_store_write_propertiesoptionalAnymagneticStoreWritePropertiesoptionalObjectMagneticStoreWritePropertiesoptionalobjectMagneticStoreWritePropertiesoptionalinterface{}#notes
This object has the following attributes:
EnableMagneticStoreWrites : A
booleanflag to enable magnetic store writes.MagneticStoreRejectedDataLocation : The location to write error reports for records rejected, asynchronously, during magnetic store writes. Only
S3Configurationobjects are allowed. TheS3Configurationobject has the following attributes:BucketName : The name of the S3 bucket.
EncryptionOption : The encryption option for the S3 location. Valid values are S3 server-side encryption with an S3 managed key (
SSE_S3) or AWS managed key (SSE_KMS).KmsKeyId : The AWS KMS key ID to use when encrypting with an AWS managed key.
ObjectKeyPrefix : The prefix to use option for the objects stored in S3.
Both BucketName and EncryptionOption are required when S3Configuration is specified. If you specify SSE_KMS as your EncryptionOption then KmsKeyId is required .
EnableMagneticStoreWrites attribute is required when MagneticStoreWriteProperties is specified. MagneticStoreRejectedDataLocation attribute is required when EnableMagneticStoreWrites is set to true .
See the following examples:
JSON
{ "Type" : AWS::Timestream::Table", "Properties":{ "DatabaseName":"TestDatabase", "TableName":"TestTable", "MagneticStoreWriteProperties":{ "EnableMagneticStoreWrites":true, "MagneticStoreRejectedDataLocation":{ "S3Configuration":{ "BucketName":" amzn-s3-demo-bucket ", "EncryptionOption":"SSE_KMS", "KmsKeyId":"1234abcd-12ab-34cd-56ef-1234567890ab", "ObjectKeyPrefix":"prefix" } } } }
}
YAML
Type: AWS::Timestream::Table
DependsOn: TestDatabase
Properties: TableName: "TestTable" DatabaseName: "TestDatabase" MagneticStoreWriteProperties: EnableMagneticStoreWrites: true MagneticStoreRejectedDataLocation: S3Configuration: BucketName: " amzn-s3-demo-bucket " EncryptionOption: "SSE_KMS" KmsKeyId: "1234abcd-12ab-34cd-56ef-1234567890ab" ObjectKeyPrefix: "prefix"
retentionPropertiesoptionalanyretention_propertiesoptionalAnyretentionPropertiesoptionalObjectRetentionPropertiesoptionalobjectRetentionPropertiesoptionalinterface{}#notes
- MemoryStoreRetentionPeriodInHours : Retention duration for memory store, in hours.
- MagneticStoreRetentionPeriodInDays : Retention duration for magnetic store, in days.
Both attributes are of type string . Both attributes are required when RetentionProperties is specified.
See the following examples:
JSON
{ "Type" : AWS::Timestream::Table", "Properties" : { "DatabaseName" : "TestDatabase", "TableName" : "TestTable", "RetentionProperties" : { "MemoryStoreRetentionPeriodInHours": "24", "MagneticStoreRetentionPeriodInDays": "7" } } }
YAML
Type: AWS::Timestream::Table
DependsOn: TestDatabase
Properties: TableName: "TestTable" DatabaseName: "TestDatabase" RetentionProperties: MemoryStoreRetentionPeriodInHours: "24" MagneticStoreRetentionPeriodInDays: "7"
schemaoptionalIResolvable | CfnTable.SchemaPropertyschemaoptionaltyping.Union[IResolvable, SchemaProperty]schemaoptionalIResolvableSchemaoptionalIResolvableSchemaoptionalinterface{}#tableNameoptionalstringtable_nameoptionalstrtableNameoptionalStringTableNameoptionalstringTableNameoptional*string#Length Constraints : Minimum length of 3 bytes. Maximum length of 256 bytes.