Class GlobalTableProps
(deprecated) Properties for the multiple DynamoDB tables to mash together into a global table.
Inheritance
Namespace: Amazon.CDK.AWS.DynamoDB.Global
Assembly: Amazon.CDK.AWS.DynamoDB.Global.dll
Syntax (csharp)
public class GlobalTableProps : Object, IGlobalTableProps, IStackProps, ITableOptions, ISchemaOptions
Syntax (vb)
Public Class GlobalTableProps
Inherits Object
Implements IGlobalTableProps, IStackProps, ITableOptions, ISchemaOptions
Remarks
Stability: Deprecated
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.DynamoDB;
using Amazon.CDK.AWS.DynamoDB.Global;
using Amazon.CDK;
var app = new App();
new GlobalTable(app, "globdynamodb", new GlobalTableProps {
PartitionKey = new Attribute { Name = "hashKey", Type = AttributeType.STRING },
TableName = "GlobalTable",
Regions = new [] { "us-east-1", "us-east-2", "us-west-2" }
});
app.Synth();
Synopsis
Constructors
GlobalTableProps() |
Properties
AnalyticsReporting | Include runtime versioning information in this Stack. |
BillingMode | Specify how you are charged for read and write throughput and how you manage capacity. |
ContributorInsightsEnabled | Whether CloudWatch contributor insights is enabled. |
Description | A description of the stack. |
Encryption | Whether server-side encryption with an AWS managed customer master key is enabled. |
EncryptionKey | External KMS key to use for table encryption. |
Env | The AWS environment (account/region) where this stack will be deployed. |
PartitionKey | Partition key attribute definition. |
PointInTimeRecovery | Whether point-in-time recovery is enabled. |
ReadCapacity | The read capacity for the table. |
Regions | (deprecated) Array of environments to create DynamoDB tables in. |
RemovalPolicy | The removal policy to apply to the DynamoDB Table. |
ReplicationRegions | Regions where replica tables will be created. |
ReplicationTimeout | The timeout for a table replication operation in a single region. |
ServerSideEncryption | (deprecated) Whether server-side encryption with an AWS managed customer master key is enabled. |
SortKey | Sort key attribute definition. |
StackName | Name to deploy the stack with. |
Stream | When an item in the table is modified, StreamViewType determines what information is written to the stream for this table. |
Synthesizer | Synthesis method to use while deploying this stack. |
TableClass | Specify the table class. |
TableName | (deprecated) Name of the DynamoDB table to use across all regional tables. |
Tags | Stack tags that will be applied to all the taggable resources and the stack itself. |
TerminationProtection | Whether to enable termination protection for this stack. |
TimeToLiveAttribute | The name of TTL attribute. |
WaitForReplicationToFinish | Indicates whether CloudFormation stack waits for replication to finish. |
WriteCapacity | The write capacity for the table. |
Constructors
GlobalTableProps()
public GlobalTableProps()
Properties
AnalyticsReporting
Include runtime versioning information in this Stack.
public Nullable<bool> AnalyticsReporting { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: analyticsReporting
setting of containing App
, or value of
'aws:cdk:version-reporting' context key
BillingMode
Specify how you are charged for read and write throughput and how you manage capacity.
public Nullable<BillingMode> BillingMode { get; set; }
Property Value
System.Nullable<BillingMode>
Remarks
Default: PROVISIONED if replicationRegions
is not specified, PAY_PER_REQUEST otherwise
ContributorInsightsEnabled
Whether CloudWatch contributor insights is enabled.
public Nullable<bool> ContributorInsightsEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
Description
A description of the stack.
public string Description { get; set; }
Property Value
System.String
Remarks
Default: - No description.
Encryption
Whether server-side encryption with an AWS managed customer master key is enabled.
public Nullable<TableEncryption> Encryption { get; set; }
Property Value
System.Nullable<TableEncryption>
Remarks
This property cannot be set if serverSideEncryption
is set.
NOTE: if you set this to CUSTOMER_MANAGED
and encryptionKey
is not
specified, the key that the Tablet generates for you will be created with
default permissions. If you are using CDKv2, these permissions will be
sufficient to enable the key for use with DynamoDB tables. If you are
using CDKv1, make sure the feature flag
@aws-cdk/aws-kms:defaultKeyPolicies
is set to true
in your cdk.json
.
Default: - server-side encryption is enabled with an AWS owned customer master key
EncryptionKey
External KMS key to use for table encryption.
public IKey EncryptionKey { get; set; }
Property Value
Remarks
This property can only be set if encryption
is set to TableEncryption.CUSTOMER_MANAGED
.
Default: - If encryption
is set to TableEncryption.CUSTOMER_MANAGED
and this
property is undefined, a new KMS key will be created and associated with this table.
Env
The AWS environment (account/region) where this stack will be deployed.
public IEnvironment Env { get; set; }
Property Value
Remarks
Set the region
/account
fields of env
to either a concrete value to
select the indicated environment (recommended for production stacks), or to
the values of environment variables
CDK_DEFAULT_REGION
/CDK_DEFAULT_ACCOUNT
to let the target environment
depend on the AWS credentials/configuration that the CDK CLI is executed
under (recommended for development stacks).
If the Stack
is instantiated inside a Stage
, any undefined
region
/account
fields from env
will default to the same field on the
encompassing Stage
, if configured there.
If either region
or account
are not set nor inherited from Stage
, the
Stack will be considered "environment-agnostic"". Environment-agnostic
stacks can be deployed to any environment but may not be able to take
advantage of all features of the CDK. For example, they will not be able to
use environmental context lookups such as ec2.Vpc.fromLookup
and will not
automatically translate Service Principals to the right format based on the
environment's AWS partition, and other such enhancements.
Default: - The environment of the containing Stage
if available,
otherwise create the stack will be environment-agnostic.
Examples
// Use a concrete account and region to deploy this stack to:
// `.account` and `.region` will simply return these values.
// Use a concrete account and region to deploy this stack to:
// `.account` and `.region` will simply return these values.
new Stack(app, "Stack1", new StackProps {
Env = new Environment {
Account = "123456789012",
Region = "us-east-1"
}
});
// Use the CLI's current credentials to determine the target environment:
// `.account` and `.region` will reflect the account+region the CLI
// is configured to use (based on the user CLI credentials)
// Use the CLI's current credentials to determine the target environment:
// `.account` and `.region` will reflect the account+region the CLI
// is configured to use (based on the user CLI credentials)
new Stack(app, "Stack2", new StackProps {
Env = new Environment {
Account = process.Env.CDK_DEFAULT_ACCOUNT,
Region = process.Env.CDK_DEFAULT_REGION
}
});
// Define multiple stacks stage associated with an environment
var myStage = new Stage(app, "MyStage", new StageProps {
Env = new Environment {
Account = "123456789012",
Region = "us-east-1"
}
});
// both of these stacks will use the stage's account/region:
// `.account` and `.region` will resolve to the concrete values as above
// both of these stacks will use the stage's account/region:
// `.account` and `.region` will resolve to the concrete values as above
new MyStack(myStage, "Stack1");
new YourStack(myStage, "Stack2");
// Define an environment-agnostic stack:
// `.account` and `.region` will resolve to `{ "Ref": "AWS::AccountId" }` and `{ "Ref": "AWS::Region" }` respectively.
// which will only resolve to actual values by CloudFormation during deployment.
// Define an environment-agnostic stack:
// `.account` and `.region` will resolve to `{ "Ref": "AWS::AccountId" }` and `{ "Ref": "AWS::Region" }` respectively.
// which will only resolve to actual values by CloudFormation during deployment.
new MyStack(app, "Stack1");
PartitionKey
Partition key attribute definition.
public IAttribute PartitionKey { get; set; }
Property Value
PointInTimeRecovery
Whether point-in-time recovery is enabled.
public Nullable<bool> PointInTimeRecovery { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - point-in-time recovery is disabled
ReadCapacity
The read capacity for the table.
public Nullable<double> ReadCapacity { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Careful if you add Global Secondary Indexes, as those will share the table's provisioned throughput.
Can only be provided if billingMode is Provisioned.
Default: 5
Regions
(deprecated) Array of environments to create DynamoDB tables in.
public string[] Regions { get; set; }
Property Value
System.String[]
Remarks
The tables will all be created in the same account.
Stability: Deprecated
RemovalPolicy
The removal policy to apply to the DynamoDB Table.
public Nullable<RemovalPolicy> RemovalPolicy { get; set; }
Property Value
System.Nullable<RemovalPolicy>
Remarks
Default: RemovalPolicy.RETAIN
ReplicationRegions
Regions where replica tables will be created.
public string[] ReplicationRegions { get; set; }
Property Value
System.String[]
Remarks
Default: - no replica tables are created
ReplicationTimeout
The timeout for a table replication operation in a single region.
public Duration ReplicationTimeout { get; set; }
Property Value
Remarks
Default: Duration.minutes(30)
ServerSideEncryption
(deprecated) Whether server-side encryption with an AWS managed customer master key is enabled.
public Nullable<bool> ServerSideEncryption { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
This property cannot be set if encryption
and/or encryptionKey
is set.
Default: - server-side encryption is enabled with an AWS owned customer master key
Stability: Deprecated
SortKey
Sort key attribute definition.
public IAttribute SortKey { get; set; }
Property Value
Remarks
Default: no sort key
StackName
Name to deploy the stack with.
public string StackName { get; set; }
Property Value
System.String
Remarks
Default: - Derived from construct path.
Stream
When an item in the table is modified, StreamViewType determines what information is written to the stream for this table.
public Nullable<StreamViewType> Stream { get; set; }
Property Value
System.Nullable<StreamViewType>
Remarks
Default: - streams are disabled unless replicationRegions
is specified
Synthesizer
Synthesis method to use while deploying this stack.
public IStackSynthesizer Synthesizer { get; set; }
Property Value
Remarks
Default: - DefaultStackSynthesizer
if the @aws-cdk/core:newStyleStackSynthesis
feature flag
is set, LegacyStackSynthesizer
otherwise.
TableClass
Specify the table class.
public Nullable<TableClass> TableClass { get; set; }
Property Value
System.Nullable<TableClass>
Remarks
Default: STANDARD
TableName
(deprecated) Name of the DynamoDB table to use across all regional tables.
public string TableName { get; set; }
Property Value
System.String
Remarks
This is required for global tables.
Stability: Deprecated
Tags
Stack tags that will be applied to all the taggable resources and the stack itself.
public IDictionary<string, string> Tags { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Default: {}
TerminationProtection
Whether to enable termination protection for this stack.
public Nullable<bool> TerminationProtection { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
TimeToLiveAttribute
The name of TTL attribute.
public string TimeToLiveAttribute { get; set; }
Property Value
System.String
Remarks
Default: - TTL is disabled
WaitForReplicationToFinish
Indicates whether CloudFormation stack waits for replication to finish.
public Nullable<bool> WaitForReplicationToFinish { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
If set to false, the CloudFormation resource will mark the resource as created and replication will be completed asynchronously. This property is ignored if replicationRegions property is not set.
DO NOT UNSET this property if adding/removing multiple replicationRegions in one deployment, as CloudFormation only supports one region replication at a time. CDK overcomes this limitation by waiting for replication to finish before starting new replicationRegion.
Default: true
WriteCapacity
The write capacity for the table.
public Nullable<double> WriteCapacity { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Careful if you add Global Secondary Indexes, as those will share the table's provisioned throughput.
Can only be provided if billingMode is Provisioned.
Default: 5