CfnGlobalTable L1 construct
The AWS::DynamoDB::GlobalTable resource enables you to create and manage a Version 2019.11.21 global table. This resource cannot be used to create or manage a Version 2017.11.29 global table. For more information, see Global tables .
You cannot convert a resource of type
AWS::DynamoDB::Tableinto a resource of typeAWS::DynamoDB::GlobalTableby changing its type in your template. Doing so might result in the deletion of your DynamoDB table.You can instead use the GlobalTable resource to create a new table in a single Region. This will be billed the same as a single Region table. If you later update the stack to add other Regions then Global Tables pricing will apply.
You should be aware of the following behaviors when working with DynamoDB global tables.
The IAM Principal executing the stack operation must have the permissions listed below in all regions where you plan to have a global table replica. The IAM Principal's permissions should not have restrictions based on IP source address. Some global tables operations (for example, adding a replica) are asynchronous, and require that the IAM Principal is valid until they complete. You should not delete the Principal (user or IAM role) until CloudFormation has finished updating your stack.
application-autoscaling:DeleteScalingPolicyapplication-autoscaling:DeleteScheduledActionapplication-autoscaling:DeregisterScalableTargetapplication-autoscaling:DescribeScalableTargetsapplication-autoscaling:DescribeScalingPoliciesapplication-autoscaling:PutScalingPolicyapplication-autoscaling:PutScheduledActionapplication-autoscaling:RegisterScalableTargetdynamodb:BatchWriteItemdynamodb:CreateGlobalTableWitnessdynamodb:CreateTabledynamodb:CreateTableReplicadynamodb:DeleteGlobalTableWitnessdynamodb:DeleteItemdynamodb:DeleteTabledynamodb:DeleteTableReplicadynamodb:DescribeContinuousBackupsdynamodb:DescribeContributorInsightsdynamodb:DescribeTabledynamodb:DescribeTableReplicaAutoScalingdynamodb:DescribeTimeToLivedynamodb:DisableKinesisStreamingDestinationdynamodb:EnableKinesisStreamingDestinationdynamodb:GetItemdynamodb:ListTablesdynamodb:ListTagsOfResourcedynamodb:PutItemdynamodb:Querydynamodb:Scandynamodb:TagResourcedynamodb:UntagResourcedynamodb:UpdateContinuousBackupsdynamodb:UpdateContributorInsightsdynamodb:UpdateItemdynamodb:UpdateTabledynamodb:UpdateTableReplicaAutoScalingdynamodb:UpdateTimeToLiveiam:CreateServiceLinkedRolekms:CreateGrantkms:DescribeKeyWhen using provisioned billing mode, CloudFormation will create an auto scaling policy on each of your replicas to control their write capacities. You must configure this policy using the
WriteProvisionedThroughputSettingsproperty. CloudFormation will ensure that all replicas have the same write capacity auto scaling property. You cannot directly specify a value for write capacity for a global table.If your table uses provisioned capacity, you must configure auto scaling directly in the
AWS::DynamoDB::GlobalTableresource. You should not configure additional auto scaling policies on any of the table replicas or global secondary indexes, either via API or viaAWS::ApplicationAutoScaling::ScalableTargetorAWS::ApplicationAutoScaling::ScalingPolicy. Doing so might result in unexpected behavior and is unsupported.In AWS CloudFormation , each global table is controlled by a single stack, in a single region, regardless of the number of replicas. When you deploy your template, CloudFormation will create/update all replicas as part of a single stack operation. You should not deploy the same
AWS::DynamoDB::GlobalTableresource in multiple regions. Doing so will result in errors, and is unsupported. If you deploy your application template in multiple regions, you can use conditions to only create the resource in a single region. Alternatively, you can choose to define yourAWS::DynamoDB::GlobalTableresources in a stack separate from your application stack, and make sure it is only deployed to a single region.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_dynamodb as dynamodb } from 'aws-cdk-lib';
declare const policyDocument: any;
const cfnGlobalTable = new dynamodb.CfnGlobalTable(this, 'MyCfnGlobalTable', {
replicas: [{
region: 'region',
// the properties below are optional
contributorInsightsSpecification: {
enabled: false,
// the properties below are optional
mode: 'mode',
},
deletionProtectionEnabled: false,
globalSecondaryIndexes: [{
indexName: 'indexName',
// the properties below are optional
contributorInsightsSpecification: {
enabled: false,
// the properties below are optional
mode: 'mode',
},
readOnDemandThroughputSettings: {
maxReadRequestUnits: 123,
},
readProvisionedThroughputSettings: {
readCapacityAutoScalingSettings: {
maxCapacity: 123,
minCapacity: 123,
targetTrackingScalingPolicyConfiguration: {
targetValue: 123,
// the properties below are optional
disableScaleIn: false,
scaleInCooldown: 123,
scaleOutCooldown: 123,
},
// the properties below are optional
seedCapacity: 123,
},
readCapacityUnits: 123,
},
}],
globalTableSettingsReplicationMode: 'globalTableSettingsReplicationMode',
kinesisStreamSpecification: {
streamArn: 'streamArn',
// the properties below are optional
approximateCreationDateTimePrecision: 'approximateCreationDateTimePrecision',
},
pointInTimeRecoverySpecification: {
pointInTimeRecoveryEnabled: false,
recoveryPeriodInDays: 123,
},
readOnDemandThroughputSettings: {
maxReadRequestUnits: 123,
},
readProvisionedThroughputSettings: {
readCapacityAutoScalingSettings: {
maxCapacity: 123,
minCapacity: 123,
targetTrackingScalingPolicyConfiguration: {
targetValue: 123,
// the properties below are optional
disableScaleIn: false,
scaleInCooldown: 123,
scaleOutCooldown: 123,
},
// the properties below are optional
seedCapacity: 123,
},
readCapacityUnits: 123,
},
replicaStreamSpecification: {
resourcePolicy: {
policyDocument: policyDocument,
},
tags: [{
key: 'key',
value: 'value',
}],
},
resourcePolicy: {
policyDocument: policyDocument,
},
sseSpecification: {
kmsMasterKeyId: 'kmsMasterKeyId',
},
tableClass: 'tableClass',
tags: [{
key: 'key',
value: 'value',
}],
}],
// the properties below are optional
attributeDefinitions: [{
attributeName: 'attributeName',
attributeType: 'attributeType',
}],
billingMode: 'billingMode',
globalSecondaryIndexes: [{
indexName: 'indexName',
keySchema: [{
attributeName: 'attributeName',
keyType: 'keyType',
}],
projection: {
nonKeyAttributes: ['nonKeyAttributes'],
projectionType: 'projectionType',
},
// the properties below are optional
readOnDemandThroughputSettings: {
maxReadRequestUnits: 123,
},
readProvisionedThroughputSettings: {
readCapacityUnits: 123,
},
warmThroughput: {
readUnitsPerSecond: 123,
writeUnitsPerSecond: 123,
},
writeOnDemandThroughputSettings: {
maxWriteRequestUnits: 123,
},
writeProvisionedThroughputSettings: {
writeCapacityAutoScalingSettings: {
maxCapacity: 123,
minCapacity: 123,
targetTrackingScalingPolicyConfiguration: {
targetValue: 123,
// the properties below are optional
disableScaleIn: false,
scaleInCooldown: 123,
scaleOutCooldown: 123,
},
// the properties below are optional
seedCapacity: 123,
},
},
}],
globalTableSourceArn: 'globalTableSourceArn',
globalTableWitnesses: [{
region: 'region',
}],
keySchema: [{
attributeName: 'attributeName',
keyType: 'keyType',
}],
localSecondaryIndexes: [{
indexName: 'indexName',
keySchema: [{
attributeName: 'attributeName',
keyType: 'keyType',
}],
projection: {
nonKeyAttributes: ['nonKeyAttributes'],
projectionType: 'projectionType',
},
}],
multiRegionConsistency: 'multiRegionConsistency',
readOnDemandThroughputSettings: {
maxReadRequestUnits: 123,
},
readProvisionedThroughputSettings: {
readCapacityUnits: 123,
},
sseSpecification: {
sseEnabled: false,
// the properties below are optional
sseType: 'sseType',
},
streamSpecification: {
streamViewType: 'streamViewType',
},
tableName: 'tableName',
timeToLiveSpecification: {
enabled: false,
// the properties below are optional
attributeName: 'attributeName',
},
vectorIndexes: [{
dimensions: 123,
distanceFunction: 'distanceFunction',
indexName: 'indexName',
projection: {
nonKeyAttributes: ['nonKeyAttributes'],
projectionType: 'projectionType',
},
vectorAttribute: {
attributeName: 'attributeName',
},
// the properties below are optional
searchSchema: [{
attributeName: 'attributeName',
searchSchemaElementType: 'searchSchemaElementType',
}],
}],
warmThroughput: {
readUnitsPerSecond: 123,
writeUnitsPerSecond: 123,
},
writeOnDemandThroughputSettings: {
maxWriteRequestUnits: 123,
},
writeProvisionedThroughputSettings: {
writeCapacityAutoScalingSettings: {
maxCapacity: 123,
minCapacity: 123,
targetTrackingScalingPolicyConfiguration: {
targetValue: 123,
// the properties below are optional
disableScaleIn: false,
scaleInCooldown: 123,
scaleOutCooldown: 123,
},
// the properties below are optional
seedCapacity: 123,
},
},
});
from aws_cdk import CfnTag, 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_dynamodb as dynamodb
# policy_document: Any
cfn_global_table = dynamodb.CfnGlobalTable(self, "MyCfnGlobalTable",
replicas=[dynamodb.CfnGlobalTable.ReplicaSpecificationProperty(
region="region",
# the properties below are optional
contributor_insights_specification=dynamodb.CfnGlobalTable.ContributorInsightsSpecificationProperty(
enabled=False,
# the properties below are optional
mode="mode"
),
deletion_protection_enabled=False,
global_secondary_indexes=[dynamodb.CfnGlobalTable.ReplicaGlobalSecondaryIndexSpecificationProperty(
index_name="indexName",
# the properties below are optional
contributor_insights_specification=dynamodb.CfnGlobalTable.ContributorInsightsSpecificationProperty(
enabled=False,
# the properties below are optional
mode="mode"
),
read_on_demand_throughput_settings=dynamodb.CfnGlobalTable.ReadOnDemandThroughputSettingsProperty(
max_read_request_units=123
),
read_provisioned_throughput_settings=dynamodb.CfnGlobalTable.ReadProvisionedThroughputSettingsProperty(
read_capacity_auto_scaling_settings=dynamodb.CfnGlobalTable.CapacityAutoScalingSettingsProperty(
max_capacity=123,
min_capacity=123,
target_tracking_scaling_policy_configuration=dynamodb.CfnGlobalTable.TargetTrackingScalingPolicyConfigurationProperty(
target_value=123,
# the properties below are optional
disable_scale_in=False,
scale_in_cooldown=123,
scale_out_cooldown=123
),
# the properties below are optional
seed_capacity=123
),
read_capacity_units=123
)
)],
global_table_settings_replication_mode="globalTableSettingsReplicationMode",
kinesis_stream_specification=dynamodb.CfnGlobalTable.KinesisStreamSpecificationProperty(
stream_arn="streamArn",
# the properties below are optional
approximate_creation_date_time_precision="approximateCreationDateTimePrecision"
),
point_in_time_recovery_specification=dynamodb.CfnGlobalTable.PointInTimeRecoverySpecificationProperty(
point_in_time_recovery_enabled=False,
recovery_period_in_days=123
),
read_on_demand_throughput_settings=dynamodb.CfnGlobalTable.ReadOnDemandThroughputSettingsProperty(
max_read_request_units=123
),
read_provisioned_throughput_settings=dynamodb.CfnGlobalTable.ReadProvisionedThroughputSettingsProperty(
read_capacity_auto_scaling_settings=dynamodb.CfnGlobalTable.CapacityAutoScalingSettingsProperty(
max_capacity=123,
min_capacity=123,
target_tracking_scaling_policy_configuration=dynamodb.CfnGlobalTable.TargetTrackingScalingPolicyConfigurationProperty(
target_value=123,
# the properties below are optional
disable_scale_in=False,
scale_in_cooldown=123,
scale_out_cooldown=123
),
# the properties below are optional
seed_capacity=123
),
read_capacity_units=123
),
replica_stream_specification=dynamodb.CfnGlobalTable.ReplicaStreamSpecificationProperty(
resource_policy=dynamodb.CfnGlobalTable.ResourcePolicyProperty(
policy_document=policy_document
),
tags=[CfnTag(
key="key",
value="value"
)]
),
resource_policy=dynamodb.CfnGlobalTable.ResourcePolicyProperty(
policy_document=policy_document
),
sse_specification=dynamodb.CfnGlobalTable.ReplicaSSESpecificationProperty(
kms_master_key_id="kmsMasterKeyId"
),
table_class="tableClass",
tags=[CfnTag(
key="key",
value="value"
)]
)],
# the properties below are optional
attribute_definitions=[dynamodb.CfnGlobalTable.AttributeDefinitionProperty(
attribute_name="attributeName",
attribute_type="attributeType"
)],
billing_mode="billingMode",
global_secondary_indexes=[dynamodb.CfnGlobalTable.GlobalSecondaryIndexProperty(
index_name="indexName",
key_schema=[dynamodb.CfnGlobalTable.KeySchemaProperty(
attribute_name="attributeName",
key_type="keyType"
)],
projection=dynamodb.CfnGlobalTable.ProjectionProperty(
non_key_attributes=["nonKeyAttributes"],
projection_type="projectionType"
),
# the properties below are optional
read_on_demand_throughput_settings=dynamodb.CfnGlobalTable.ReadOnDemandThroughputSettingsProperty(
max_read_request_units=123
),
read_provisioned_throughput_settings=dynamodb.CfnGlobalTable.GlobalReadProvisionedThroughputSettingsProperty(
read_capacity_units=123
),
warm_throughput=dynamodb.CfnGlobalTable.WarmThroughputProperty(
read_units_per_second=123,
write_units_per_second=123
),
write_on_demand_throughput_settings=dynamodb.CfnGlobalTable.WriteOnDemandThroughputSettingsProperty(
max_write_request_units=123
),
write_provisioned_throughput_settings=dynamodb.CfnGlobalTable.WriteProvisionedThroughputSettingsProperty(
write_capacity_auto_scaling_settings=dynamodb.CfnGlobalTable.CapacityAutoScalingSettingsProperty(
max_capacity=123,
min_capacity=123,
target_tracking_scaling_policy_configuration=dynamodb.CfnGlobalTable.TargetTrackingScalingPolicyConfigurationProperty(
target_value=123,
# the properties below are optional
disable_scale_in=False,
scale_in_cooldown=123,
scale_out_cooldown=123
),
# the properties below are optional
seed_capacity=123
)
)
)],
global_table_source_arn="globalTableSourceArn",
global_table_witnesses=[dynamodb.CfnGlobalTable.GlobalTableWitnessProperty(
region="region"
)],
key_schema=[dynamodb.CfnGlobalTable.KeySchemaProperty(
attribute_name="attributeName",
key_type="keyType"
)],
local_secondary_indexes=[dynamodb.CfnGlobalTable.LocalSecondaryIndexProperty(
index_name="indexName",
key_schema=[dynamodb.CfnGlobalTable.KeySchemaProperty(
attribute_name="attributeName",
key_type="keyType"
)],
projection=dynamodb.CfnGlobalTable.ProjectionProperty(
non_key_attributes=["nonKeyAttributes"],
projection_type="projectionType"
)
)],
multi_region_consistency="multiRegionConsistency",
read_on_demand_throughput_settings=dynamodb.CfnGlobalTable.ReadOnDemandThroughputSettingsProperty(
max_read_request_units=123
),
read_provisioned_throughput_settings=dynamodb.CfnGlobalTable.GlobalReadProvisionedThroughputSettingsProperty(
read_capacity_units=123
),
sse_specification=dynamodb.CfnGlobalTable.SSESpecificationProperty(
sse_enabled=False,
# the properties below are optional
sse_type="sseType"
),
stream_specification=dynamodb.CfnGlobalTable.StreamSpecificationProperty(
stream_view_type="streamViewType"
),
table_name="tableName",
time_to_live_specification=dynamodb.CfnGlobalTable.TimeToLiveSpecificationProperty(
enabled=False,
# the properties below are optional
attribute_name="attributeName"
),
vector_indexes=[dynamodb.CfnGlobalTable.VectorIndexProperty(
dimensions=123,
distance_function="distanceFunction",
index_name="indexName",
projection=dynamodb.CfnGlobalTable.ProjectionProperty(
non_key_attributes=["nonKeyAttributes"],
projection_type="projectionType"
),
vector_attribute=dynamodb.CfnGlobalTable.VectorAttributeProperty(
attribute_name="attributeName"
),
# the properties below are optional
search_schema=[dynamodb.CfnGlobalTable.SearchSchemaElementProperty(
attribute_name="attributeName",
search_schema_element_type="searchSchemaElementType"
)]
)],
warm_throughput=dynamodb.CfnGlobalTable.WarmThroughputProperty(
read_units_per_second=123,
write_units_per_second=123
),
write_on_demand_throughput_settings=dynamodb.CfnGlobalTable.WriteOnDemandThroughputSettingsProperty(
max_write_request_units=123
),
write_provisioned_throughput_settings=dynamodb.CfnGlobalTable.WriteProvisionedThroughputSettingsProperty(
write_capacity_auto_scaling_settings=dynamodb.CfnGlobalTable.CapacityAutoScalingSettingsProperty(
max_capacity=123,
min_capacity=123,
target_tracking_scaling_policy_configuration=dynamodb.CfnGlobalTable.TargetTrackingScalingPolicyConfigurationProperty(
target_value=123,
# the properties below are optional
disable_scale_in=False,
scale_in_cooldown=123,
scale_out_cooldown=123
),
# the properties below are optional
seed_capacity=123
)
)
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.dynamodb.*;
Object policyDocument;
CfnGlobalTable cfnGlobalTable = CfnGlobalTable.Builder.create(this, "MyCfnGlobalTable")
.replicas(List.of(ReplicaSpecificationProperty.builder()
.region("region")
// the properties below are optional
.contributorInsightsSpecification(ContributorInsightsSpecificationProperty.builder()
.enabled(false)
// the properties below are optional
.mode("mode")
.build())
.deletionProtectionEnabled(false)
.globalSecondaryIndexes(List.of(ReplicaGlobalSecondaryIndexSpecificationProperty.builder()
.indexName("indexName")
// the properties below are optional
.contributorInsightsSpecification(ContributorInsightsSpecificationProperty.builder()
.enabled(false)
// the properties below are optional
.mode("mode")
.build())
.readOnDemandThroughputSettings(ReadOnDemandThroughputSettingsProperty.builder()
.maxReadRequestUnits(123)
.build())
.readProvisionedThroughputSettings(ReadProvisionedThroughputSettingsProperty.builder()
.readCapacityAutoScalingSettings(CapacityAutoScalingSettingsProperty.builder()
.maxCapacity(123)
.minCapacity(123)
.targetTrackingScalingPolicyConfiguration(TargetTrackingScalingPolicyConfigurationProperty.builder()
.targetValue(123)
// the properties below are optional
.disableScaleIn(false)
.scaleInCooldown(123)
.scaleOutCooldown(123)
.build())
// the properties below are optional
.seedCapacity(123)
.build())
.readCapacityUnits(123)
.build())
.build()))
.globalTableSettingsReplicationMode("globalTableSettingsReplicationMode")
.kinesisStreamSpecification(KinesisStreamSpecificationProperty.builder()
.streamArn("streamArn")
// the properties below are optional
.approximateCreationDateTimePrecision("approximateCreationDateTimePrecision")
.build())
.pointInTimeRecoverySpecification(PointInTimeRecoverySpecificationProperty.builder()
.pointInTimeRecoveryEnabled(false)
.recoveryPeriodInDays(123)
.build())
.readOnDemandThroughputSettings(ReadOnDemandThroughputSettingsProperty.builder()
.maxReadRequestUnits(123)
.build())
.readProvisionedThroughputSettings(ReadProvisionedThroughputSettingsProperty.builder()
.readCapacityAutoScalingSettings(CapacityAutoScalingSettingsProperty.builder()
.maxCapacity(123)
.minCapacity(123)
.targetTrackingScalingPolicyConfiguration(TargetTrackingScalingPolicyConfigurationProperty.builder()
.targetValue(123)
// the properties below are optional
.disableScaleIn(false)
.scaleInCooldown(123)
.scaleOutCooldown(123)
.build())
// the properties below are optional
.seedCapacity(123)
.build())
.readCapacityUnits(123)
.build())
.replicaStreamSpecification(ReplicaStreamSpecificationProperty.builder()
.resourcePolicy(ResourcePolicyProperty.builder()
.policyDocument(policyDocument)
.build())
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build())
.resourcePolicy(ResourcePolicyProperty.builder()
.policyDocument(policyDocument)
.build())
.sseSpecification(ReplicaSSESpecificationProperty.builder()
.kmsMasterKeyId("kmsMasterKeyId")
.build())
.tableClass("tableClass")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build()))
// the properties below are optional
.attributeDefinitions(List.of(AttributeDefinitionProperty.builder()
.attributeName("attributeName")
.attributeType("attributeType")
.build()))
.billingMode("billingMode")
.globalSecondaryIndexes(List.of(GlobalSecondaryIndexProperty.builder()
.indexName("indexName")
.keySchema(List.of(KeySchemaProperty.builder()
.attributeName("attributeName")
.keyType("keyType")
.build()))
.projection(ProjectionProperty.builder()
.nonKeyAttributes(List.of("nonKeyAttributes"))
.projectionType("projectionType")
.build())
// the properties below are optional
.readOnDemandThroughputSettings(ReadOnDemandThroughputSettingsProperty.builder()
.maxReadRequestUnits(123)
.build())
.readProvisionedThroughputSettings(GlobalReadProvisionedThroughputSettingsProperty.builder()
.readCapacityUnits(123)
.build())
.warmThroughput(WarmThroughputProperty.builder()
.readUnitsPerSecond(123)
.writeUnitsPerSecond(123)
.build())
.writeOnDemandThroughputSettings(WriteOnDemandThroughputSettingsProperty.builder()
.maxWriteRequestUnits(123)
.build())
.writeProvisionedThroughputSettings(WriteProvisionedThroughputSettingsProperty.builder()
.writeCapacityAutoScalingSettings(CapacityAutoScalingSettingsProperty.builder()
.maxCapacity(123)
.minCapacity(123)
.targetTrackingScalingPolicyConfiguration(TargetTrackingScalingPolicyConfigurationProperty.builder()
.targetValue(123)
// the properties below are optional
.disableScaleIn(false)
.scaleInCooldown(123)
.scaleOutCooldown(123)
.build())
// the properties below are optional
.seedCapacity(123)
.build())
.build())
.build()))
.globalTableSourceArn("globalTableSourceArn")
.globalTableWitnesses(List.of(GlobalTableWitnessProperty.builder()
.region("region")
.build()))
.keySchema(List.of(KeySchemaProperty.builder()
.attributeName("attributeName")
.keyType("keyType")
.build()))
.localSecondaryIndexes(List.of(LocalSecondaryIndexProperty.builder()
.indexName("indexName")
.keySchema(List.of(KeySchemaProperty.builder()
.attributeName("attributeName")
.keyType("keyType")
.build()))
.projection(ProjectionProperty.builder()
.nonKeyAttributes(List.of("nonKeyAttributes"))
.projectionType("projectionType")
.build())
.build()))
.multiRegionConsistency("multiRegionConsistency")
.readOnDemandThroughputSettings(ReadOnDemandThroughputSettingsProperty.builder()
.maxReadRequestUnits(123)
.build())
.readProvisionedThroughputSettings(GlobalReadProvisionedThroughputSettingsProperty.builder()
.readCapacityUnits(123)
.build())
.sseSpecification(SSESpecificationProperty.builder()
.sseEnabled(false)
// the properties below are optional
.sseType("sseType")
.build())
.streamSpecification(StreamSpecificationProperty.builder()
.streamViewType("streamViewType")
.build())
.tableName("tableName")
.timeToLiveSpecification(TimeToLiveSpecificationProperty.builder()
.enabled(false)
// the properties below are optional
.attributeName("attributeName")
.build())
.vectorIndexes(List.of(VectorIndexProperty.builder()
.dimensions(123)
.distanceFunction("distanceFunction")
.indexName("indexName")
.projection(ProjectionProperty.builder()
.nonKeyAttributes(List.of("nonKeyAttributes"))
.projectionType("projectionType")
.build())
.vectorAttribute(VectorAttributeProperty.builder()
.attributeName("attributeName")
.build())
// the properties below are optional
.searchSchema(List.of(SearchSchemaElementProperty.builder()
.attributeName("attributeName")
.searchSchemaElementType("searchSchemaElementType")
.build()))
.build()))
.warmThroughput(WarmThroughputProperty.builder()
.readUnitsPerSecond(123)
.writeUnitsPerSecond(123)
.build())
.writeOnDemandThroughputSettings(WriteOnDemandThroughputSettingsProperty.builder()
.maxWriteRequestUnits(123)
.build())
.writeProvisionedThroughputSettings(WriteProvisionedThroughputSettingsProperty.builder()
.writeCapacityAutoScalingSettings(CapacityAutoScalingSettingsProperty.builder()
.maxCapacity(123)
.minCapacity(123)
.targetTrackingScalingPolicyConfiguration(TargetTrackingScalingPolicyConfigurationProperty.builder()
.targetValue(123)
// the properties below are optional
.disableScaleIn(false)
.scaleInCooldown(123)
.scaleOutCooldown(123)
.build())
// the properties below are optional
.seedCapacity(123)
.build())
.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.DynamoDB;
var policyDocument;
var cfnGlobalTable = new CfnGlobalTable(this, "MyCfnGlobalTable", new CfnGlobalTableProps {
Replicas = new [] { new ReplicaSpecificationProperty {
Region = "region",
// the properties below are optional
ContributorInsightsSpecification = new ContributorInsightsSpecificationProperty {
Enabled = false,
// the properties below are optional
Mode = "mode"
},
DeletionProtectionEnabled = false,
GlobalSecondaryIndexes = new [] { new ReplicaGlobalSecondaryIndexSpecificationProperty {
IndexName = "indexName",
// the properties below are optional
ContributorInsightsSpecification = new ContributorInsightsSpecificationProperty {
Enabled = false,
// the properties below are optional
Mode = "mode"
},
ReadOnDemandThroughputSettings = new ReadOnDemandThroughputSettingsProperty {
MaxReadRequestUnits = 123
},
ReadProvisionedThroughputSettings = new ReadProvisionedThroughputSettingsProperty {
ReadCapacityAutoScalingSettings = new CapacityAutoScalingSettingsProperty {
MaxCapacity = 123,
MinCapacity = 123,
TargetTrackingScalingPolicyConfiguration = new TargetTrackingScalingPolicyConfigurationProperty {
TargetValue = 123,
// the properties below are optional
DisableScaleIn = false,
ScaleInCooldown = 123,
ScaleOutCooldown = 123
},
// the properties below are optional
SeedCapacity = 123
},
ReadCapacityUnits = 123
}
} },
GlobalTableSettingsReplicationMode = "globalTableSettingsReplicationMode",
KinesisStreamSpecification = new KinesisStreamSpecificationProperty {
StreamArn = "streamArn",
// the properties below are optional
ApproximateCreationDateTimePrecision = "approximateCreationDateTimePrecision"
},
PointInTimeRecoverySpecification = new PointInTimeRecoverySpecificationProperty {
PointInTimeRecoveryEnabled = false,
RecoveryPeriodInDays = 123
},
ReadOnDemandThroughputSettings = new ReadOnDemandThroughputSettingsProperty {
MaxReadRequestUnits = 123
},
ReadProvisionedThroughputSettings = new ReadProvisionedThroughputSettingsProperty {
ReadCapacityAutoScalingSettings = new CapacityAutoScalingSettingsProperty {
MaxCapacity = 123,
MinCapacity = 123,
TargetTrackingScalingPolicyConfiguration = new TargetTrackingScalingPolicyConfigurationProperty {
TargetValue = 123,
// the properties below are optional
DisableScaleIn = false,
ScaleInCooldown = 123,
ScaleOutCooldown = 123
},
// the properties below are optional
SeedCapacity = 123
},
ReadCapacityUnits = 123
},
ReplicaStreamSpecification = new ReplicaStreamSpecificationProperty {
ResourcePolicy = new ResourcePolicyProperty {
PolicyDocument = policyDocument
},
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
},
ResourcePolicy = new ResourcePolicyProperty {
PolicyDocument = policyDocument
},
SseSpecification = new ReplicaSSESpecificationProperty {
KmsMasterKeyId = "kmsMasterKeyId"
},
TableClass = "tableClass",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
} },
// the properties below are optional
AttributeDefinitions = new [] { new AttributeDefinitionProperty {
AttributeName = "attributeName",
AttributeType = "attributeType"
} },
BillingMode = "billingMode",
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
ReadOnDemandThroughputSettings = new ReadOnDemandThroughputSettingsProperty {
MaxReadRequestUnits = 123
},
ReadProvisionedThroughputSettings = new GlobalReadProvisionedThroughputSettingsProperty {
ReadCapacityUnits = 123
},
WarmThroughput = new WarmThroughputProperty {
ReadUnitsPerSecond = 123,
WriteUnitsPerSecond = 123
},
WriteOnDemandThroughputSettings = new WriteOnDemandThroughputSettingsProperty {
MaxWriteRequestUnits = 123
},
WriteProvisionedThroughputSettings = new WriteProvisionedThroughputSettingsProperty {
WriteCapacityAutoScalingSettings = new CapacityAutoScalingSettingsProperty {
MaxCapacity = 123,
MinCapacity = 123,
TargetTrackingScalingPolicyConfiguration = new TargetTrackingScalingPolicyConfigurationProperty {
TargetValue = 123,
// the properties below are optional
DisableScaleIn = false,
ScaleInCooldown = 123,
ScaleOutCooldown = 123
},
// the properties below are optional
SeedCapacity = 123
}
}
} },
GlobalTableSourceArn = "globalTableSourceArn",
GlobalTableWitnesses = new [] { new GlobalTableWitnessProperty {
Region = "region"
} },
KeySchema = new [] { new KeySchemaProperty {
AttributeName = "attributeName",
KeyType = "keyType"
} },
LocalSecondaryIndexes = new [] { new LocalSecondaryIndexProperty {
IndexName = "indexName",
KeySchema = new [] { new KeySchemaProperty {
AttributeName = "attributeName",
KeyType = "keyType"
} },
Projection = new ProjectionProperty {
NonKeyAttributes = new [] { "nonKeyAttributes" },
ProjectionType = "projectionType"
}
} },
MultiRegionConsistency = "multiRegionConsistency",
ReadOnDemandThroughputSettings = new ReadOnDemandThroughputSettingsProperty {
MaxReadRequestUnits = 123
},
ReadProvisionedThroughputSettings = new GlobalReadProvisionedThroughputSettingsProperty {
ReadCapacityUnits = 123
},
SseSpecification = new SSESpecificationProperty {
SseEnabled = false,
// the properties below are optional
SseType = "sseType"
},
StreamSpecification = new StreamSpecificationProperty {
StreamViewType = "streamViewType"
},
TableName = "tableName",
TimeToLiveSpecification = new TimeToLiveSpecificationProperty {
Enabled = false,
// the properties below are optional
AttributeName = "attributeName"
},
VectorIndexes = new [] { new VectorIndexProperty {
Dimensions = 123,
DistanceFunction = "distanceFunction",
IndexName = "indexName",
Projection = new ProjectionProperty {
NonKeyAttributes = new [] { "nonKeyAttributes" },
ProjectionType = "projectionType"
},
VectorAttribute = new VectorAttributeProperty {
AttributeName = "attributeName"
},
// the properties below are optional
SearchSchema = new [] { new SearchSchemaElementProperty {
AttributeName = "attributeName",
SearchSchemaElementType = "searchSchemaElementType"
} }
} },
WarmThroughput = new WarmThroughputProperty {
ReadUnitsPerSecond = 123,
WriteUnitsPerSecond = 123
},
WriteOnDemandThroughputSettings = new WriteOnDemandThroughputSettingsProperty {
MaxWriteRequestUnits = 123
},
WriteProvisionedThroughputSettings = new WriteProvisionedThroughputSettingsProperty {
WriteCapacityAutoScalingSettings = new CapacityAutoScalingSettingsProperty {
MaxCapacity = 123,
MinCapacity = 123,
TargetTrackingScalingPolicyConfiguration = new TargetTrackingScalingPolicyConfigurationProperty {
TargetValue = 123,
// the properties below are optional
DisableScaleIn = false,
ScaleInCooldown = 123,
ScaleOutCooldown = 123
},
// the properties below are optional
SeedCapacity = 123
}
}
});
// 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 policyDocument interface{}
cfnGlobalTable := awscdk.Aws_dynamodb.NewCfnGlobalTable(this, jsii.String("MyCfnGlobalTable"), &CfnGlobalTableProps{
Replicas: []interface{}{
&ReplicaSpecificationProperty{
Region: jsii.String("region"),
// the properties below are optional
ContributorInsightsSpecification: &ContributorInsightsSpecificationProperty{
Enabled: jsii.Boolean(false),
// the properties below are optional
Mode: jsii.String("mode"),
},
DeletionProtectionEnabled: jsii.Boolean(false),
GlobalSecondaryIndexes: []interface{}{
&ReplicaGlobalSecondaryIndexSpecificationProperty{
IndexName: jsii.String("indexName"),
// the properties below are optional
ContributorInsightsSpecification: &ContributorInsightsSpecificationProperty{
Enabled: jsii.Boolean(false),
// the properties below are optional
Mode: jsii.String("mode"),
},
ReadOnDemandThroughputSettings: &ReadOnDemandThroughputSettingsProperty{
MaxReadRequestUnits: jsii.Number(123),
},
ReadProvisionedThroughputSettings: &ReadProvisionedThroughputSettingsProperty{
ReadCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
MaxCapacity: jsii.Number(123),
MinCapacity: jsii.Number(123),
TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
TargetValue: jsii.Number(123),
// the properties below are optional
DisableScaleIn: jsii.Boolean(false),
ScaleInCooldown: jsii.Number(123),
ScaleOutCooldown: jsii.Number(123),
},
// the properties below are optional
SeedCapacity: jsii.Number(123),
},
ReadCapacityUnits: jsii.Number(123),
},
},
},
GlobalTableSettingsReplicationMode: jsii.String("globalTableSettingsReplicationMode"),
KinesisStreamSpecification: &KinesisStreamSpecificationProperty{
StreamArn: jsii.String("streamArn"),
// the properties below are optional
ApproximateCreationDateTimePrecision: jsii.String("approximateCreationDateTimePrecision"),
},
PointInTimeRecoverySpecification: &PointInTimeRecoverySpecificationProperty{
PointInTimeRecoveryEnabled: jsii.Boolean(false),
RecoveryPeriodInDays: jsii.Number(123),
},
ReadOnDemandThroughputSettings: &ReadOnDemandThroughputSettingsProperty{
MaxReadRequestUnits: jsii.Number(123),
},
ReadProvisionedThroughputSettings: &ReadProvisionedThroughputSettingsProperty{
ReadCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
MaxCapacity: jsii.Number(123),
MinCapacity: jsii.Number(123),
TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
TargetValue: jsii.Number(123),
// the properties below are optional
DisableScaleIn: jsii.Boolean(false),
ScaleInCooldown: jsii.Number(123),
ScaleOutCooldown: jsii.Number(123),
},
// the properties below are optional
SeedCapacity: jsii.Number(123),
},
ReadCapacityUnits: jsii.Number(123),
},
ReplicaStreamSpecification: &ReplicaStreamSpecificationProperty{
ResourcePolicy: &ResourcePolicyProperty{
PolicyDocument: policyDocument,
},
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
},
ResourcePolicy: &ResourcePolicyProperty{
PolicyDocument: policyDocument,
},
SseSpecification: &ReplicaSSESpecificationProperty{
KmsMasterKeyId: jsii.String("kmsMasterKeyId"),
},
TableClass: jsii.String("tableClass"),
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
},
},
// the properties below are optional
AttributeDefinitions: []interface{}{
&AttributeDefinitionProperty{
AttributeName: jsii.String("attributeName"),
AttributeType: jsii.String("attributeType"),
},
},
BillingMode: jsii.String("billingMode"),
GlobalSecondaryIndexes: []interface{}{
&GlobalSecondaryIndexProperty{
IndexName: jsii.String("indexName"),
KeySchema: []interface{}{
&KeySchemaProperty{
AttributeName: jsii.String("attributeName"),
KeyType: jsii.String("keyType"),
},
},
Projection: &ProjectionProperty{
NonKeyAttributes: []*string{
jsii.String("nonKeyAttributes"),
},
ProjectionType: jsii.String("projectionType"),
},
// the properties below are optional
ReadOnDemandThroughputSettings: &ReadOnDemandThroughputSettingsProperty{
MaxReadRequestUnits: jsii.Number(123),
},
ReadProvisionedThroughputSettings: &GlobalReadProvisionedThroughputSettingsProperty{
ReadCapacityUnits: jsii.Number(123),
},
WarmThroughput: &WarmThroughputProperty{
ReadUnitsPerSecond: jsii.Number(123),
WriteUnitsPerSecond: jsii.Number(123),
},
WriteOnDemandThroughputSettings: &WriteOnDemandThroughputSettingsProperty{
MaxWriteRequestUnits: jsii.Number(123),
},
WriteProvisionedThroughputSettings: &WriteProvisionedThroughputSettingsProperty{
WriteCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
MaxCapacity: jsii.Number(123),
MinCapacity: jsii.Number(123),
TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
TargetValue: jsii.Number(123),
// the properties below are optional
DisableScaleIn: jsii.Boolean(false),
ScaleInCooldown: jsii.Number(123),
ScaleOutCooldown: jsii.Number(123),
},
// the properties below are optional
SeedCapacity: jsii.Number(123),
},
},
},
},
GlobalTableSourceArn: jsii.String("globalTableSourceArn"),
GlobalTableWitnesses: []interface{}{
&GlobalTableWitnessProperty{
Region: jsii.String("region"),
},
},
KeySchema: []interface{}{
&KeySchemaProperty{
AttributeName: jsii.String("attributeName"),
KeyType: jsii.String("keyType"),
},
},
LocalSecondaryIndexes: []interface{}{
&LocalSecondaryIndexProperty{
IndexName: jsii.String("indexName"),
KeySchema: []interface{}{
&KeySchemaProperty{
AttributeName: jsii.String("attributeName"),
KeyType: jsii.String("keyType"),
},
},
Projection: &ProjectionProperty{
NonKeyAttributes: []*string{
jsii.String("nonKeyAttributes"),
},
ProjectionType: jsii.String("projectionType"),
},
},
},
MultiRegionConsistency: jsii.String("multiRegionConsistency"),
ReadOnDemandThroughputSettings: &ReadOnDemandThroughputSettingsProperty{
MaxReadRequestUnits: jsii.Number(123),
},
ReadProvisionedThroughputSettings: &GlobalReadProvisionedThroughputSettingsProperty{
ReadCapacityUnits: jsii.Number(123),
},
SseSpecification: &SSESpecificationProperty{
SseEnabled: jsii.Boolean(false),
// the properties below are optional
SseType: jsii.String("sseType"),
},
StreamSpecification: &StreamSpecificationProperty{
StreamViewType: jsii.String("streamViewType"),
},
TableName: jsii.String("tableName"),
TimeToLiveSpecification: &TimeToLiveSpecificationProperty{
Enabled: jsii.Boolean(false),
// the properties below are optional
AttributeName: jsii.String("attributeName"),
},
VectorIndexes: []interface{}{
&VectorIndexProperty{
Dimensions: jsii.Number(123),
DistanceFunction: jsii.String("distanceFunction"),
IndexName: jsii.String("indexName"),
Projection: &ProjectionProperty{
NonKeyAttributes: []*string{
jsii.String("nonKeyAttributes"),
},
ProjectionType: jsii.String("projectionType"),
},
VectorAttribute: &VectorAttributeProperty{
AttributeName: jsii.String("attributeName"),
},
// the properties below are optional
SearchSchema: []interface{}{
&SearchSchemaElementProperty{
AttributeName: jsii.String("attributeName"),
SearchSchemaElementType: jsii.String("searchSchemaElementType"),
},
},
},
},
WarmThroughput: &WarmThroughputProperty{
ReadUnitsPerSecond: jsii.Number(123),
WriteUnitsPerSecond: jsii.Number(123),
},
WriteOnDemandThroughputSettings: &WriteOnDemandThroughputSettingsProperty{
MaxWriteRequestUnits: jsii.Number(123),
},
WriteProvisionedThroughputSettings: &WriteProvisionedThroughputSettingsProperty{
WriteCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
MaxCapacity: jsii.Number(123),
MinCapacity: jsii.Number(123),
TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
TargetValue: jsii.Number(123),
// the properties below are optional
DisableScaleIn: jsii.Boolean(false),
ScaleInCooldown: jsii.Number(123),
ScaleOutCooldown: jsii.Number(123),
},
// the properties below are optional
SeedCapacity: jsii.Number(123),
},
},
})
Initializer
new CfnGlobalTable(scope: Construct, id: string, props: CfnGlobalTableProps)
CfnGlobalTable(scope: Construct, id: str, props: CfnGlobalTableProps)
new CfnGlobalTable(Construct scope, String id, CfnGlobalTableProps props)
new CfnGlobalTable(Construct scope, string id, CfnGlobalTableProps props)
NewCfnGlobalTable(Scope Construct, Id *string, Props CfnGlobalTableProps)
Construct Props
attributeDefinitionsoptionalIResolvable | IResolvable | CfnGlobalTable.AttributeDefinitionProperty[]attribute_definitionsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AttributeDefinitionProperty]]]attributeDefinitionsoptionalIResolvableAttributeDefinitionsoptionalIResolvableAttributeDefinitionsoptionalinterface{}#billingModeoptionalstringbilling_modeoptionalstrbillingModeoptionalStringBillingModeoptionalstringBillingModeoptional*string#notes
PAY_PER_REQUESTPROVISIONED
All replicas in your global table will have the same billing mode. If you use PROVISIONED billing mode, you must provide an auto scaling configuration via the WriteProvisionedThroughputSettings property. The default value of this property is PROVISIONED .
globalSecondaryIndexesoptionalIResolvable | IResolvable | CfnGlobalTable.GlobalSecondaryIndexProperty[]global_secondary_indexesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, GlobalSecondaryIndexProperty]]]globalSecondaryIndexesoptionalIResolvableGlobalSecondaryIndexesoptionalIResolvableGlobalSecondaryIndexesoptionalinterface{}#notes
You can create up to 20 global secondary indexes. Each replica in your global table will have the same global secondary index settings. You can only create or delete one global secondary index in a single stack operation.
Since the backfilling of an index could take a long time, CloudFormation does not wait for the index to become active. If a stack operation rolls back, CloudFormation might not delete an index that has been added. In that case, you will need to delete the index manually.
globalTableSourceArnoptionalstringglobal_table_source_arnoptionalstrglobalTableSourceArnoptionalStringGlobalTableSourceArnoptionalstringGlobalTableSourceArnoptional*string#globalTableWitnessesoptionalIResolvable | IResolvable | CfnGlobalTable.GlobalTableWitnessProperty[]global_table_witnessesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, GlobalTableWitnessProperty]]]globalTableWitnessesoptionalIResolvableGlobalTableWitnessesoptionalIResolvableGlobalTableWitnessesoptionalinterface{}#Only one witness Region can be configured per MRSC global table.
keySchemaoptionalIResolvable | IResolvable | CfnGlobalTable.KeySchemaProperty[]key_schemaoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, KeySchemaProperty]]]keySchemaoptionalIResolvableKeySchemaoptionalIResolvableKeySchemaoptionalinterface{}#The attributes in the KeySchema property must also be defined in the AttributeDefinitions property.
localSecondaryIndexesoptionalIResolvable | IResolvable | CfnGlobalTable.LocalSecondaryIndexProperty[]local_secondary_indexesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, LocalSecondaryIndexProperty]]]localSecondaryIndexesoptionalIResolvableLocalSecondaryIndexesoptionalIResolvableLocalSecondaryIndexesoptionalinterface{}#You can create up to five 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. Each replica in your global table will have the same local secondary index settings.
multiRegionConsistencyoptionalstringmulti_region_consistencyoptionalstrmultiRegionConsistencyoptionalStringMultiRegionConsistencyoptionalstringMultiRegionConsistencyoptional*string#notes
You can specify one of the following consistency modes:
EVENTUAL: Configures a new global table for multi-Region eventual consistency (MREC).STRONG: Configures a new global table for multi-Region strong consistency (MRSC).
If you don't specify this field, the global table consistency mode defaults to EVENTUAL . For more information about global tables consistency modes, see Consistency modes in DynamoDB developer guide.
readOnDemandThroughputSettingsoptionalIResolvable | CfnGlobalTable.ReadOnDemandThroughputSettingsPropertyread_on_demand_throughput_settingsoptionaltyping.Union[IResolvable, ReadOnDemandThroughputSettingsProperty]readOnDemandThroughputSettingsoptionalIResolvableReadOnDemandThroughputSettingsoptionalIResolvableReadOnDemandThroughputSettingsoptionalinterface{}#readProvisionedThroughputSettingsoptionalIResolvable | CfnGlobalTable.GlobalReadProvisionedThroughputSettingsPropertyread_provisioned_throughput_settingsoptionaltyping.Union[IResolvable, GlobalReadProvisionedThroughputSettingsProperty]readProvisionedThroughputSettingsoptionalIResolvableReadProvisionedThroughputSettingsoptionalIResolvableReadProvisionedThroughputSettingsoptionalinterface{}#replicasIResolvable | IResolvable | CfnGlobalTable.ReplicaSpecificationProperty[]replicastyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicaSpecificationProperty]]]replicasIResolvableReplicasIResolvableReplicasinterface{}required#notes
The list must contain at least one element, the region where the stack defining the global table is deployed. For example, if you define your table in a stack deployed to us-east-1, you must have an entry in Replicas with the region us-east-1. You cannot remove the replica in the stack region.
Adding a replica might take a few minutes for an empty table, or up to several hours for large tables. If you want to add or remove a replica, we recommend submitting an
UpdateStackoperation containing only that change.If you add or delete a replica 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 replica, you might need to manually delete the replica.
You can create a new global table with as many replicas as needed. You can add or remove replicas after table creation, but you can only add or remove a single replica in each update. For Multi-Region Strong Consistency (MRSC), you can add or remove up to 3 replicas, or 2 replicas plus a witness Region.
sseSpecificationoptionalIResolvable | CfnGlobalTable.SSESpecificationPropertysse_specificationoptionaltyping.Union[IResolvable, SSESpecificationProperty]sseSpecificationoptionalIResolvableSseSpecificationoptionalIResolvableSseSpecificationoptionalinterface{}#These settings will be applied to all replicas. If you plan to use customer-managed KMS keys, you must provide a key for each replica using the ReplicaSpecification.ReplicaSSESpecification property.
streamSpecificationoptionalIResolvable | CfnGlobalTable.StreamSpecificationPropertystream_specificationoptionaltyping.Union[IResolvable, StreamSpecificationProperty]streamSpecificationoptionalIResolvableStreamSpecificationoptionalIResolvableStreamSpecificationoptionalinterface{}#notes
You must provide a value for this property if your global table contains more than one replica. You can only change the streams settings if your global table has only one replica. For Multi-Region Strong Consistency (MRSC), you do not need to provide a value for this property and can change the settings at any time.
tableNameoptionalstringtable_nameoptionalstrtableNameoptionalStringTableNameoptionalstringTableNameoptional*string#notes
If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID as 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.
timeToLiveSpecificationoptionalIResolvable | CfnGlobalTable.TimeToLiveSpecificationPropertytime_to_live_specificationoptionaltyping.Union[IResolvable, TimeToLiveSpecificationProperty]timeToLiveSpecificationoptionalIResolvableTimeToLiveSpecificationoptionalIResolvableTimeToLiveSpecificationoptionalinterface{}#This setting will be applied to all replicas.
vectorIndexesoptionalIResolvable | IResolvable | CfnGlobalTable.VectorIndexProperty[]vector_indexesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, VectorIndexProperty]]]vectorIndexesoptionalIResolvableVectorIndexesoptionalIResolvableVectorIndexesoptionalinterface{}#warmThroughputoptionalIResolvable | CfnGlobalTable.WarmThroughputPropertywarm_throughputoptionaltyping.Union[IResolvable, WarmThroughputProperty]warmThroughputoptionalIResolvableWarmThroughputoptionalIResolvableWarmThroughputoptionalinterface{}#The settings can be modified using the UpdateTable operation to meet the throughput requirements of an upcoming peak event.
writeOnDemandThroughputSettingsoptionalIResolvable | CfnGlobalTable.WriteOnDemandThroughputSettingsPropertywrite_on_demand_throughput_settingsoptionaltyping.Union[IResolvable, WriteOnDemandThroughputSettingsProperty]writeOnDemandThroughputSettingsoptionalIResolvableWriteOnDemandThroughputSettingsoptionalIResolvableWriteOnDemandThroughputSettingsoptionalinterface{}#You can only specify this setting if your resource uses the PAY_PER_REQUEST BillingMode .
writeProvisionedThroughputSettingsoptionalIResolvable | CfnGlobalTable.WriteProvisionedThroughputSettingsPropertywrite_provisioned_throughput_settingsoptionaltyping.Union[IResolvable, WriteProvisionedThroughputSettingsProperty]writeProvisionedThroughputSettingsoptionalIResolvableWriteProvisionedThroughputSettingsoptionalIResolvableWriteProvisionedThroughputSettingsoptionalinterface{}#This policy will be applied to all replicas. This setting must be specified if BillingMode is set to PROVISIONED .
Properties
The ARN returned is that of the replica in the region the stack is deployed to.
attributeDefinitionsmay be undefinedIResolvable | IResolvable | CfnGlobalTable.AttributeDefinitionProperty[]attribute_definitionsmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AttributeDefinitionProperty]]]attributeDefinitionsmay be undefinedIResolvableAttributeDefinitionsmay be undefinedIResolvableAttributeDefinitionsmay be undefinedinterface{}#You must specify the
StreamSpecificationproperty to use this attribute.
The TableId returned is that of the replica in the region the stack is deployed to.
billingModemay be undefinedstringbilling_modemay be undefinedstrbillingModemay be undefinedStringBillingModemay be undefinedstringBillingModemay be undefined*string#Valid values are:.
CFN_RESOURCE_TYPE_NAMEstringcfn_resource_type_namestrCFN_RESOURCE_TYPE_NAMEStringCFN_RESOURCE_TYPE_NAMEstringCFN_RESOURCE_TYPE_NAME*stringstatic#cfnOptionsICfnResourceOptionscfn_optionsICfnResourceOptionscfnOptionsICfnResourceOptionsCfnOptionsICfnResourceOptionsCfnOptionsICfnResourceOptions#cfnResourceTypestringcfn_resource_typestrcfnResourceTypeStringCfnResourceTypestringCfnResourceType*string#creationStackstring[]creation_stacktyping.List[str]creationStackList<String>CreationStackstring[]CreationStack*[]*string#globalSecondaryIndexesmay be undefinedIResolvable | IResolvable | CfnGlobalTable.GlobalSecondaryIndexProperty[]global_secondary_indexesmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, GlobalSecondaryIndexProperty]]]globalSecondaryIndexesmay be undefinedIResolvableGlobalSecondaryIndexesmay be undefinedIResolvableGlobalSecondaryIndexesmay be undefinedinterface{}#globalTableRefGlobalTableReferenceglobal_table_refGlobalTableReferenceglobalTableRefGlobalTableReferenceGlobalTableRefGlobalTableReferenceGlobalTableRefGlobalTableReference#globalTableSourceArnmay be undefinedstringglobal_table_source_arnmay be undefinedstrglobalTableSourceArnmay be undefinedStringGlobalTableSourceArnmay be undefinedstringGlobalTableSourceArnmay be undefined*string#globalTableWitnessesmay be undefinedIResolvable | IResolvable | CfnGlobalTable.GlobalTableWitnessProperty[]global_table_witnessesmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, GlobalTableWitnessProperty]]]globalTableWitnessesmay be undefinedIResolvableGlobalTableWitnessesmay be undefinedIResolvableGlobalTableWitnessesmay be undefinedinterface{}#keySchemamay be undefinedIResolvable | IResolvable | CfnGlobalTable.KeySchemaProperty[]key_schemamay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, KeySchemaProperty]]]keySchemamay be undefinedIResolvableKeySchemamay be undefinedIResolvableKeySchemamay be undefinedinterface{}#localSecondaryIndexesmay be undefinedIResolvable | IResolvable | CfnGlobalTable.LocalSecondaryIndexProperty[]local_secondary_indexesmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, LocalSecondaryIndexProperty]]]localSecondaryIndexesmay be undefinedIResolvableLocalSecondaryIndexesmay be undefinedIResolvableLocalSecondaryIndexesmay be undefinedinterface{}#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).
multiRegionConsistencymay be undefinedstringmulti_region_consistencymay be undefinedstrmultiRegionConsistencymay be undefinedStringMultiRegionConsistencymay be undefinedstringMultiRegionConsistencymay be undefined*string#readOnDemandThroughputSettingsmay be undefinedIResolvable | CfnGlobalTable.ReadOnDemandThroughputSettingsPropertyread_on_demand_throughput_settingsmay be undefinedtyping.Union[IResolvable, ReadOnDemandThroughputSettingsProperty]readOnDemandThroughputSettingsmay be undefinedIResolvableReadOnDemandThroughputSettingsmay be undefinedIResolvableReadOnDemandThroughputSettingsmay be undefinedinterface{}#readProvisionedThroughputSettingsmay be undefinedIResolvable | CfnGlobalTable.GlobalReadProvisionedThroughputSettingsPropertyread_provisioned_throughput_settingsmay be undefinedtyping.Union[IResolvable, GlobalReadProvisionedThroughputSettingsProperty]readProvisionedThroughputSettingsmay be undefinedIResolvableReadProvisionedThroughputSettingsmay be undefinedIResolvableReadProvisionedThroughputSettingsmay be undefinedinterface{}#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 }).
replicasIResolvable | IResolvable | CfnGlobalTable.ReplicaSpecificationProperty[]replicastyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicaSpecificationProperty]]]replicasIResolvableReplicasIResolvableReplicasinterface{}#sseSpecificationmay be undefinedIResolvable | CfnGlobalTable.SSESpecificationPropertysse_specificationmay be undefinedtyping.Union[IResolvable, SSESpecificationProperty]sseSpecificationmay be undefinedIResolvableSseSpecificationmay be undefinedIResolvableSseSpecificationmay be undefinedinterface{}#CfnElements must be defined within a stack scope (directly or indirectly).
streamSpecificationmay be undefinedIResolvable | CfnGlobalTable.StreamSpecificationPropertystream_specificationmay be undefinedtyping.Union[IResolvable, StreamSpecificationProperty]streamSpecificationmay be undefinedIResolvableStreamSpecificationmay be undefinedIResolvableStreamSpecificationmay be undefinedinterface{}#tableNamemay be undefinedstringtable_namemay be undefinedstrtableNamemay be undefinedStringTableNamemay be undefinedstringTableNamemay be undefined*string#timeToLiveSpecificationmay be undefinedIResolvable | CfnGlobalTable.TimeToLiveSpecificationPropertytime_to_live_specificationmay be undefinedtyping.Union[IResolvable, TimeToLiveSpecificationProperty]timeToLiveSpecificationmay be undefinedIResolvableTimeToLiveSpecificationmay be undefinedIResolvableTimeToLiveSpecificationmay be undefinedinterface{}#vectorIndexesmay be undefinedIResolvable | IResolvable | CfnGlobalTable.VectorIndexProperty[]vector_indexesmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, VectorIndexProperty]]]vectorIndexesmay be undefinedIResolvableVectorIndexesmay be undefinedIResolvableVectorIndexesmay be undefinedinterface{}#warmThroughputmay be undefinedIResolvable | CfnGlobalTable.WarmThroughputPropertywarm_throughputmay be undefinedtyping.Union[IResolvable, WarmThroughputProperty]warmThroughputmay be undefinedIResolvableWarmThroughputmay be undefinedIResolvableWarmThroughputmay be undefinedinterface{}#writeOnDemandThroughputSettingsmay be undefinedIResolvable | CfnGlobalTable.WriteOnDemandThroughputSettingsPropertywrite_on_demand_throughput_settingsmay be undefinedtyping.Union[IResolvable, WriteOnDemandThroughputSettingsProperty]writeOnDemandThroughputSettingsmay be undefinedIResolvableWriteOnDemandThroughputSettingsmay be undefinedIResolvableWriteOnDemandThroughputSettingsmay be undefinedinterface{}#writeProvisionedThroughputSettingsmay be undefinedIResolvable | CfnGlobalTable.WriteProvisionedThroughputSettingsPropertywrite_provisioned_throughput_settingsmay be undefinedtyping.Union[IResolvable, WriteProvisionedThroughputSettingsProperty]writeProvisionedThroughputSettingsmay be undefinedIResolvableWriteProvisionedThroughputSettingsmay be undefinedIResolvableWriteProvisionedThroughputSettingsmay be undefinedinterface{}#Methods
addDeletionOverride(path: string): voiddef add_deletion_override(self, path: str) -> Nonepublic void addDeletionOverride(String path)public void AddDeletionOverride(string path)func AddDeletionOverride(Path *string)#1 parameter
Parameters
pathpathpathpathPath— The path of the value to delete.
addDependency(target: CfnResource): voiddef add_dependency(self, target: CfnResource) -> Nonepublic void addDependency(CfnResource target)public void AddDependency(CfnResource target)func AddDependency(Target CfnResource)deprecated#This method has been renamed to addResourceDependency to more clearly set it apart from construct.node.addDependency. See the documentation of that function for more details.
addDependsOn(target: CfnResource): voiddef add_depends_on(self, target: CfnResource) -> Nonepublic void addDependsOn(CfnResource target)public void AddDependsOn(CfnResource target)func AddDependsOn(Target CfnResource)deprecated#notes
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
This method has been renamed to addResourceDependency, which makes it more clear that this method operates at a different level from the construct-level construct.node.addDependency() mechanism.
addMetadata(key: string, value: any): voiddef add_metadata(self, key: str, value: Any) -> Nonepublic void addMetadata(String key, Object value)public void AddMetadata(string key, object value)func AddMetadata(Key *string, Value interface{})#addOverride(path: string, value: any): voiddef add_override(self, path: str, value: Any) -> Nonepublic void addOverride(String path, Object value)public void AddOverride(string path, object value)func AddOverride(Path *string, Value interface{})#notes · 2 parameters
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,
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
would add the overrides
"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
pathpathpathpathPath— - The path of the property, you can use dot notation to override values in complex types.valuevaluevaluevalueValue— - The value.
addPropertyDeletionOverride(propertyPath: string): voiddef add_property_deletion_override(self, property_path: str) -> Nonepublic void addPropertyDeletionOverride(String propertyPath)public void AddPropertyDeletionOverride(string propertyPath)func AddPropertyDeletionOverride(PropertyPath *string)#1 parameter
Parameters
propertyPathproperty_pathpropertyPathpropertyPathPropertyPath— The path to the property.
addPropertyOverride(propertyPath: string, value: any): voiddef add_property_override(self, property_path: str, value: Any) -> Nonepublic void addPropertyOverride(String propertyPath, Object value)public void AddPropertyOverride(string propertyPath, object value)func AddPropertyOverride(PropertyPath *string, Value interface{})#Syntactic sugar for addOverride("Properties.<...>", value).
2 parameters
Parameters
propertyPathproperty_pathpropertyPathpropertyPathPropertyPath— The path of the property.valuevaluevaluevalueValue— The value.
addResourceDependency(target: CfnResource, reason?: string): voiddef add_resource_dependency(self, target: CfnResource, reason: typing.Optional[str] = None) -> Nonepublic void addResourceDependency(CfnResource target, String reason)public void AddResourceDependency(CfnResource target, string? reason = null)func AddResourceDependency(Target CfnResource, Reason *string)#notes
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
This method only adds dependencies between L1 resources. If you are looking for a generic construct-to-construct dependency mechanism that works for all constructs including L2s, use construct.node.addDependency instead.
applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#When set, any cross-stack reference to this resource will use the specified strength instead of the global default from the consuming stack's context.
1 parameter
Parameters
strengthstrengthstrengthstrengthStrength— - The reference strength to use for this resource.
applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): voiddef apply_removal_policy(self, policy: typing.Optional[RemovalPolicy] = None, options: typing.Optional[RemovalPolicyOptions] = None) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)public void ApplyRemovalPolicy(RemovalPolicy? policy = null, RemovalPolicyOptions? options = null)func ApplyRemovalPolicy(Policy RemovalPolicy, Options RemovalPolicyOptions)#notes
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:
arnForGlobalTable(resource: IGlobalTableRef): string@staticmethod def arn_for_global_table(resource: IGlobalTableRef) -> strpublic static String arnForGlobalTable(IGlobalTableRef resource)public static string ArnForGlobalTable(IGlobalTableRef resource)func ArnForGlobalTable(Resource IGlobalTableRef) *stringstatic#cfnPropertyName(cdkPropertyName: string): stringdef cfn_property_name(self, cdk_property_name: str) -> strpublic String cfnPropertyName(String cdkPropertyName)public string CfnPropertyName(string cdkPropertyName)func CfnPropertyName(CdkPropertyName *string) *string#getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Referencedef get_att(self, attribute_name: str, type_hint: typing.Optional[ResolutionTypeHint] = None) -> Referencepublic Reference getAtt(String attributeName, ResolutionTypeHint typeHint)public Reference GetAtt(string attributeName, ResolutionTypeHint? typeHint = null)func GetAtt(AttributeName *string, TypeHint ResolutionTypeHint) Reference#Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.
1 parameter
Parameters
attributeNameattribute_nameattributeNameattributeNameAttributeName— The name of the attribute.
getMetadata(key: string): anydef get_metadata(self, key: str) -> Anypublic Object getMetadata(String key)public object GetMetadata(string key)func GetMetadata(Key *string) interface{}#inspect(inspector: TreeInspector): voiddef inspect(self, inspector: TreeInspector) -> Nonepublic void inspect(TreeInspector inspector)public void Inspect(TreeInspector inspector)func Inspect(Inspector TreeInspector)#1 parameter
Parameters
inspectorinspectorinspectorinspectorInspector— tree inspector to collect and process attributes.
isCfnElement(x: any): boolean@staticmethod def is_cfn_element(x: Any) -> boolpublic static Boolean isCfnElement(Object x)public static bool IsCfnElement(object x)func IsCfnElement(X interface{}) *boolstatic#Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.
returns
Returns: The construct as a stack element or undefined if it is not a stack element.
isCfnGlobalTable(x: any): boolean@staticmethod def is_cfn_global_table(x: Any) -> boolpublic static Boolean isCfnGlobalTable(Object x)public static bool IsCfnGlobalTable(object x)func IsCfnGlobalTable(X interface{}) *boolstatic#isCfnResource(x: any): boolean@staticmethod def is_cfn_resource(x: Any) -> boolpublic static Boolean isCfnResource(Object x)public static bool IsCfnResource(object x)func IsCfnResource(X interface{}) *boolstatic#isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#notes · 1 parameter · returns
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
xxxxX— Any object.
Returns: true if x is an object created from a class which extends Construct.
obtainDependencies(): Stack | CfnResource[]def obtain_dependencies(self, ) -> typing.List[typing.Union[Stack, CfnResource]]public List<Stack> obtainDependencies()public Stack[] ObtainDependencies()func ObtainDependencies() *[]interface{}#For resources depended on directly, returns the CfnResource object. For dependencies on other stacks, returns the Stack object. The order of the array is not guaranteed.
overrideLogicalId(newLogicalId: string): voiddef override_logical_id(self, new_logical_id: str) -> Nonepublic void overrideLogicalId(String newLogicalId)public void OverrideLogicalId(string newLogicalId)func OverrideLogicalId(NewLogicalId *string)#1 parameter
Parameters
newLogicalIdnew_logical_idnewLogicalIdnewLogicalIdNewLogicalId— The new logical ID to use for this stack element.
removeDependency(target: CfnResource): voiddef remove_dependency(self, target: CfnResource) -> Nonepublic void removeDependency(CfnResource target)public void RemoveDependency(CfnResource target)func RemoveDependency(Target CfnResource)deprecated#This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
removeResourceDependency(target: CfnResource): voiddef remove_resource_dependency(self, target: CfnResource) -> Nonepublic void removeResourceDependency(CfnResource target)public void RemoveResourceDependency(CfnResource target)func RemoveResourceDependency(Target CfnResource)#This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
replaceDependency(target: CfnResource, newTarget: CfnResource): voiddef replace_dependency(self, target: CfnResource, new_target: CfnResource) -> Nonepublic void replaceDependency(CfnResource target, CfnResource newTarget)public void ReplaceDependency(CfnResource target, CfnResource newTarget)func ReplaceDependency(Target CfnResource, NewTarget CfnResource)#2 parameters
Parameters
targettargettargettargetTarget— The dependency to replace.newTargetnew_targetnewTargetnewTargetNewTarget— The new dependency to add.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#returns
Returns: a string representation of this resource
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.