class CfnGlobalTablePropsMixin
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.AWS.DynamoDB.Mixins.CfnGlobalTablePropsMixin |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/awsdynamodb/mixins#CfnGlobalTablePropsMixin |
Java | software.amazon.awscdk.mixins.preview.services.dynamodb.mixins.CfnGlobalTablePropsMixin |
Python | aws_cdk.mixins_preview.aws_dynamodb.mixins.CfnGlobalTablePropsMixin |
TypeScript | @aws-cdk/mixins-preview » aws_dynamodb » mixins » CfnGlobalTablePropsMixin |
Implements
IMixin
Extends
Mixin
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.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { mixins } from '@aws-cdk/mixins-preview';
import { mixins as dynamodb_mixins } from '@aws-cdk/mixins-preview/aws-dynamodb';
declare const policyDocument: any;
const cfnGlobalTablePropsMixin = new dynamodb_mixins.CfnGlobalTablePropsMixin({
attributeDefinitions: [{
attributeName: 'attributeName',
attributeType: 'attributeType',
}],
billingMode: 'billingMode',
globalSecondaryIndexes: [{
indexName: 'indexName',
keySchema: [{
attributeName: 'attributeName',
keyType: 'keyType',
}],
projection: {
nonKeyAttributes: ['nonKeyAttributes'],
projectionType: 'projectionType',
},
warmThroughput: {
readUnitsPerSecond: 123,
writeUnitsPerSecond: 123,
},
writeOnDemandThroughputSettings: {
maxWriteRequestUnits: 123,
},
writeProvisionedThroughputSettings: {
writeCapacityAutoScalingSettings: {
maxCapacity: 123,
minCapacity: 123,
seedCapacity: 123,
targetTrackingScalingPolicyConfiguration: {
disableScaleIn: false,
scaleInCooldown: 123,
scaleOutCooldown: 123,
targetValue: 123,
},
},
},
}],
globalTableWitnesses: [{
region: 'region',
}],
keySchema: [{
attributeName: 'attributeName',
keyType: 'keyType',
}],
localSecondaryIndexes: [{
indexName: 'indexName',
keySchema: [{
attributeName: 'attributeName',
keyType: 'keyType',
}],
projection: {
nonKeyAttributes: ['nonKeyAttributes'],
projectionType: 'projectionType',
},
}],
multiRegionConsistency: 'multiRegionConsistency',
replicas: [{
contributorInsightsSpecification: {
enabled: false,
mode: 'mode',
},
deletionProtectionEnabled: false,
globalSecondaryIndexes: [{
contributorInsightsSpecification: {
enabled: false,
mode: 'mode',
},
indexName: 'indexName',
readOnDemandThroughputSettings: {
maxReadRequestUnits: 123,
},
readProvisionedThroughputSettings: {
readCapacityAutoScalingSettings: {
maxCapacity: 123,
minCapacity: 123,
seedCapacity: 123,
targetTrackingScalingPolicyConfiguration: {
disableScaleIn: false,
scaleInCooldown: 123,
scaleOutCooldown: 123,
targetValue: 123,
},
},
readCapacityUnits: 123,
},
}],
kinesisStreamSpecification: {
approximateCreationDateTimePrecision: 'approximateCreationDateTimePrecision',
streamArn: 'streamArn',
},
pointInTimeRecoverySpecification: {
pointInTimeRecoveryEnabled: false,
recoveryPeriodInDays: 123,
},
readOnDemandThroughputSettings: {
maxReadRequestUnits: 123,
},
readProvisionedThroughputSettings: {
readCapacityAutoScalingSettings: {
maxCapacity: 123,
minCapacity: 123,
seedCapacity: 123,
targetTrackingScalingPolicyConfiguration: {
disableScaleIn: false,
scaleInCooldown: 123,
scaleOutCooldown: 123,
targetValue: 123,
},
},
readCapacityUnits: 123,
},
region: 'region',
replicaStreamSpecification: {
resourcePolicy: {
policyDocument: policyDocument,
},
},
resourcePolicy: {
policyDocument: policyDocument,
},
sseSpecification: {
kmsMasterKeyId: 'kmsMasterKeyId',
},
tableClass: 'tableClass',
tags: [{
key: 'key',
value: 'value',
}],
}],
sseSpecification: {
sseEnabled: false,
sseType: 'sseType',
},
streamSpecification: {
streamViewType: 'streamViewType',
},
tableName: 'tableName',
timeToLiveSpecification: {
attributeName: 'attributeName',
enabled: false,
},
warmThroughput: {
readUnitsPerSecond: 123,
writeUnitsPerSecond: 123,
},
writeOnDemandThroughputSettings: {
maxWriteRequestUnits: 123,
},
writeProvisionedThroughputSettings: {
writeCapacityAutoScalingSettings: {
maxCapacity: 123,
minCapacity: 123,
seedCapacity: 123,
targetTrackingScalingPolicyConfiguration: {
disableScaleIn: false,
scaleInCooldown: 123,
scaleOutCooldown: 123,
targetValue: 123,
},
},
},
}, /* all optional props */ {
strategy: mixins.PropertyMergeStrategy.OVERRIDE,
});
Initializer
new CfnGlobalTablePropsMixin(props: CfnGlobalTableMixinProps, options?: CfnPropertyMixinOptions)
Parameters
- props
Cfn— L1 properties to apply.Global Table Mixin Props - options
Cfn— Mixin options.Property Mixin Options
Create a mixin to apply properties to AWS::DynamoDB::GlobalTable.
Properties
| Name | Type | Description |
|---|---|---|
| props | Cfn | |
| strategy | Property | |
| static CFN_PROPERTY_KEYS | string[] |
props
Type:
Cfn
strategy
Type:
Property
static CFN_PROPERTY_KEYS
Type:
string[]
Methods
| Name | Description |
|---|---|
| apply | Apply the mixin properties to the construct. |
| supports(construct) | Check if this mixin supports the given construct. |
applyTo(construct)
public applyTo(construct: IConstruct): IConstruct
Parameters
- construct
IConstruct
Returns
Apply the mixin properties to the construct.
supports(construct)
public supports(construct: IConstruct): boolean
Parameters
- construct
IConstruct
Returns
boolean
Check if this mixin supports the given construct.

.NET
Go
Java
Python
TypeScript