class CfnGlobalTable (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.DynamoDB.CfnGlobalTable |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsdynamodb#CfnGlobalTable |
![]() | software.amazon.awscdk.services.dynamodb.CfnGlobalTable |
![]() | aws_cdk.aws_dynamodb.CfnGlobalTable |
![]() | aws-cdk-lib » aws_dynamodb » CfnGlobalTable |
Implements
IConstruct
, IDependable
, IInspectable
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::Table
into a resource of typeAWS::DynamoDB::GlobalTable
by 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.
dynamodb:CreateTable
dynamodb:UpdateTable
dynamodb:DeleteTable
dynamodb:DescribeContinuousBackups
dynamodb:DescribeContributorInsights
dynamodb:DescribeTable
dynamodb:DescribeTableReplicaAutoScaling
dynamodb:DescribeTimeToLive
dynamodb:ListTables
dynamodb:UpdateTimeToLive
dynamodb:UpdateContributorInsights
dynamodb:UpdateContinuousBackups
dynamodb:ListTagsOfResource
dynamodb:TagResource
dynamodb:UntagResource
dynamodb:BatchWriteItem
dynamodb:CreateTableReplica
dynamodb:DeleteItem
dynamodb:DeleteTableReplica
dynamodb:DisableKinesisStreamingDestination
dynamodb:EnableKinesisStreamingDestination
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:Scan
dynamodb:UpdateItem
dynamodb:DescribeTableReplicaAutoScaling
dynamodb:UpdateTableReplicaAutoScaling
iam:CreateServiceLinkedRole
kms:CreateGrant
kms:DescribeKey
application-autoscaling:DeleteScalingPolicy
application-autoscaling:DeleteScheduledAction
application-autoscaling:DeregisterScalableTarget
application-autoscaling:DescribeScalingPolicies
application-autoscaling:DescribeScalableTargets
application-autoscaling:PutScalingPolicy
application-autoscaling:PutScheduledAction
application-autoscaling:RegisterScalableTarget
When 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
WriteProvisionedThroughputSettings
property. 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::GlobalTable
resource. You should not configure additional auto scaling policies on any of the table replicas or global secondary indexes, either via API or viaAWS::ApplicationAutoScaling::ScalableTarget
orAWS::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::GlobalTable
resource 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::GlobalTable
resources 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 { aws_dynamodb as dynamodb } from 'aws-cdk-lib';
declare const policyDocument: any;
const cfnGlobalTable = new dynamodb.CfnGlobalTable(this, 'MyCfnGlobalTable', {
attributeDefinitions: [{
attributeName: 'attributeName',
attributeType: 'attributeType',
}],
keySchema: [{
attributeName: 'attributeName',
keyType: 'keyType',
}],
replicas: [{
region: 'region',
// the properties below are optional
contributorInsightsSpecification: {
enabled: false,
},
deletionProtectionEnabled: false,
globalSecondaryIndexes: [{
indexName: 'indexName',
// the properties below are optional
contributorInsightsSpecification: {
enabled: false,
},
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,
},
}],
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,
},
},
resourcePolicy: {
policyDocument: policyDocument,
},
sseSpecification: {
kmsMasterKeyId: 'kmsMasterKeyId',
},
tableClass: 'tableClass',
tags: [{
key: 'key',
value: 'value',
}],
}],
// the properties below are optional
billingMode: 'billingMode',
globalSecondaryIndexes: [{
indexName: 'indexName',
keySchema: [{
attributeName: 'attributeName',
keyType: 'keyType',
}],
projection: {
nonKeyAttributes: ['nonKeyAttributes'],
projectionType: 'projectionType',
},
// the properties below are optional
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,
},
},
}],
localSecondaryIndexes: [{
indexName: 'indexName',
keySchema: [{
attributeName: 'attributeName',
keyType: 'keyType',
}],
projection: {
nonKeyAttributes: ['nonKeyAttributes'],
projectionType: 'projectionType',
},
}],
pointInTimeRecoverySpecification: {
pointInTimeRecoveryEnabled: false,
recoveryPeriodInDays: 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',
},
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,
},
},
});
Initializer
new CfnGlobalTable(scope: Construct, id: string, props: CfnGlobalTableProps)
Parameters
- scope
Construct
— Scope in which this resource is defined. - id
string
— Construct identifier for this resource (unique in its scope). - props
Cfn
— Resource properties.Global Table Props
Construct Props
Name | Type | Description |
---|---|---|
attribute | IResolvable | IResolvable | Attribute [] | A list of attributes that describe the key schema for the global table and indexes. |
key | IResolvable | IResolvable | Key [] | Specifies the attributes that make up the primary key for the table. |
replicas | IResolvable | IResolvable | Replica [] | Specifies the list of replicas for your global table. |
billing | string | Specifies how you are charged for read and write throughput and how you manage capacity. Valid values are:. |
global | IResolvable | IResolvable | Global [] | Global secondary indexes to be created on the global table. |
local | IResolvable | IResolvable | Local [] | Local secondary indexes to be created on the table. |
point | IResolvable | Point | Represents the settings used to enable point in time recovery. |
sse | IResolvable | SSESpecification | Specifies the settings to enable server-side encryption. |
stream | IResolvable | Stream | Specifies the streams settings on your global table. |
table | string | A name for the global table. |
time | IResolvable | Time | Specifies the time to live (TTL) settings for the table. |
warm | IResolvable | Warm | Provides visibility into the number of read and write operations your table or secondary index can instantaneously support. |
write | IResolvable | Write | Sets the write request settings for a global table or a global secondary index. |
write | IResolvable | Write | Specifies an auto scaling policy for write capacity. |
attributeDefinitions
Type:
IResolvable
|
IResolvable
|
Attribute
[]
A list of attributes that describe the key schema for the global table and indexes.
keySchema
Type:
IResolvable
|
IResolvable
|
Key
[]
Specifies the attributes that make up the primary key for the table.
The attributes in the KeySchema
property must also be defined in the AttributeDefinitions
property.
replicas
Type:
IResolvable
|
IResolvable
|
Replica
[]
Specifies the list of replicas for your global table.
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
UpdateStack
operation 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.
billingMode?
Type:
string
(optional)
Specifies how you are charged for read and write throughput and how you manage capacity. Valid values are:.
PAY_PER_REQUEST
PROVISIONED
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
.
globalSecondaryIndexes?
Type:
IResolvable
|
IResolvable
|
Global
[]
(optional)
Global secondary indexes to be created on the global table.
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.
localSecondaryIndexes?
Type:
IResolvable
|
IResolvable
|
Local
[]
(optional)
Local secondary indexes to be created on the table.
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.
pointInTimeRecoverySpecification?
Type:
IResolvable
|
Point
(optional)
Represents the settings used to enable point in time recovery.
sseSpecification?
Type:
IResolvable
|
SSESpecification
(optional)
Specifies the settings to enable server-side encryption.
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.
streamSpecification?
Type:
IResolvable
|
Stream
(optional)
Specifies the streams settings on your global table.
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.
tableName?
Type:
string
(optional)
A name for the global table.
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.
timeToLiveSpecification?
Type:
IResolvable
|
Time
(optional)
Specifies the time to live (TTL) settings for the table.
This setting will be applied to all replicas.
warmThroughput?
Type:
IResolvable
|
Warm
(optional)
Provides visibility into the number of read and write operations your table or secondary index can instantaneously support.
The settings can be modified using the UpdateTable
operation to meet the throughput requirements of an upcoming peak event.
writeOnDemandThroughputSettings?
Type:
IResolvable
|
Write
(optional)
Sets the write request settings for a global table or a global secondary index.
You can only specify this setting if your resource uses the PAY_PER_REQUEST
BillingMode
.
writeProvisionedThroughputSettings?
Type:
IResolvable
|
Write
(optional)
Specifies an auto scaling policy for write capacity.
This policy will be applied to all replicas. This setting must be specified if BillingMode
is set to PROVISIONED
.
Properties
Name | Type | Description |
---|---|---|
attr | string | The Amazon Resource Name (ARN) of the DynamoDB table, such as arn:aws:dynamodb:us-east-2:123456789012:table/myDynamoDBTable . |
attr | string | The ARN of the DynamoDB stream, such as arn:aws:dynamodb:us-east-1:123456789012:table/testddbstack-myDynamoDBTable-012A1SL7SMP5Q/stream/2015-11-30T20:10:00.000 . The StreamArn returned is that of the replica in the region the stack is deployed to. |
attr | string | Unique identifier for the table, such as a123b456-01ab-23cd-123a-111222aaabbb . |
attribute | IResolvable | IResolvable | Attribute [] | A list of attributes that describe the key schema for the global table and indexes. |
cfn | ICfn | Options for this resource, such as condition, update policy etc. |
cfn | { [string]: any } | |
cfn | string | AWS resource type. |
creation | string[] | |
key | IResolvable | IResolvable | Key [] | Specifies the attributes that make up the primary key for the table. |
logical | string | The logical ID for this CloudFormation stack element. |
node | Node | The tree node. |
ref | string | Return a string that will be resolved to a CloudFormation { Ref } for this element. |
replicas | IResolvable | IResolvable | Replica [] | Specifies the list of replicas for your global table. |
stack | Stack | The stack in which this element is defined. |
billing | string | Specifies how you are charged for read and write throughput and how you manage capacity. |
global | IResolvable | IResolvable | Global [] | Global secondary indexes to be created on the global table. |
local | IResolvable | IResolvable | Local [] | Local secondary indexes to be created on the table. |
point | IResolvable | Point | Represents the settings used to enable point in time recovery. |
sse | IResolvable | SSESpecification | Specifies the settings to enable server-side encryption. |
stream | IResolvable | Stream | Specifies the streams settings on your global table. |
table | string | A name for the global table. |
time | IResolvable | Time | Specifies the time to live (TTL) settings for the table. |
warm | IResolvable | Warm | Provides visibility into the number of read and write operations your table or secondary index can instantaneously support. |
write | IResolvable | Write | Sets the write request settings for a global table or a global secondary index. |
write | IResolvable | Write | Specifies an auto scaling policy for write capacity. |
static CFN_RESOURCE_TYPE_NAME | string | The CloudFormation resource type name for this resource class. |
attrArn
Type:
string
The Amazon Resource Name (ARN) of the DynamoDB table, such as arn:aws:dynamodb:us-east-2:123456789012:table/myDynamoDBTable
.
The ARN returned is that of the replica in the region the stack is deployed to.
attrStreamArn
Type:
string
The ARN of the DynamoDB stream, such as arn:aws:dynamodb:us-east-1:123456789012:table/testddbstack-myDynamoDBTable-012A1SL7SMP5Q/stream/2015-11-30T20:10:00.000
. The StreamArn
returned is that of the replica in the region the stack is deployed to.
You must specify the
StreamSpecification
property to use this attribute.
attrTableId
Type:
string
Unique identifier for the table, such as a123b456-01ab-23cd-123a-111222aaabbb
.
The TableId
returned is that of the replica in the region the stack is deployed to.
attributeDefinitions
Type:
IResolvable
|
IResolvable
|
Attribute
[]
A list of attributes that describe the key schema for the global table and indexes.
cfnOptions
Type:
ICfn
Options for this resource, such as condition, update policy etc.
cfnProperties
Type:
{ [string]: any }
cfnResourceType
Type:
string
AWS resource type.
creationStack
Type:
string[]
keySchema
Type:
IResolvable
|
IResolvable
|
Key
[]
Specifies the attributes that make up the primary key for the table.
logicalId
Type:
string
The logical ID for this CloudFormation stack element.
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)
.
node
Type:
Node
The tree node.
ref
Type:
string
Return a string that will be resolved to a CloudFormation { Ref }
for this element.
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 })
.
replicas
Type:
IResolvable
|
IResolvable
|
Replica
[]
Specifies the list of replicas for your global table.
stack
Type:
Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
billingMode?
Type:
string
(optional)
Specifies how you are charged for read and write throughput and how you manage capacity.
Valid values are:.
globalSecondaryIndexes?
Type:
IResolvable
|
IResolvable
|
Global
[]
(optional)
Global secondary indexes to be created on the global table.
localSecondaryIndexes?
Type:
IResolvable
|
IResolvable
|
Local
[]
(optional)
Local secondary indexes to be created on the table.
pointInTimeRecoverySpecification?
Type:
IResolvable
|
Point
(optional)
Represents the settings used to enable point in time recovery.
sseSpecification?
Type:
IResolvable
|
SSESpecification
(optional)
Specifies the settings to enable server-side encryption.
streamSpecification?
Type:
IResolvable
|
Stream
(optional)
Specifies the streams settings on your global table.
tableName?
Type:
string
(optional)
A name for the global table.
timeToLiveSpecification?
Type:
IResolvable
|
Time
(optional)
Specifies the time to live (TTL) settings for the table.
warmThroughput?
Type:
IResolvable
|
Warm
(optional)
Provides visibility into the number of read and write operations your table or secondary index can instantaneously support.
writeOnDemandThroughputSettings?
Type:
IResolvable
|
Write
(optional)
Sets the write request settings for a global table or a global secondary index.
writeProvisionedThroughputSettings?
Type:
IResolvable
|
Write
(optional)
Specifies an auto scaling policy for write capacity.
static CFN_RESOURCE_TYPE_NAME
Type:
string
The CloudFormation resource type name for this resource class.
Methods
Name | Description |
---|---|
add | Syntactic sugar for addOverride(path, undefined) . |
add | Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
add | Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
add | Add a value to the CloudFormation Resource Metadata. |
add | Adds an override to the synthesized CloudFormation resource. |
add | Adds an override that deletes the value of a property from the resource definition. |
add | Adds an override to a resource property. |
apply | Sets the deletion policy of the resource based on the removal policy specified. |
get | Returns a token for an runtime attribute of this resource. |
get | Retrieve a value value from the CloudFormation Resource Metadata. |
inspect(inspector) | Examines the CloudFormation resource and discloses attributes. |
obtain | Retrieves an array of resources this resource depends on. |
obtain | Get a shallow copy of dependencies between this resource and other resources in the same stack. |
override | Overrides the auto-generated logical ID with a specific ID. |
remove | Indicates that this resource no longer depends on another resource. |
replace | Replaces one dependency with another. |
to | Returns a string representation of this construct. |
protected render |
addDeletionOverride(path)
public addDeletionOverride(path: string): void
Parameters
- path
string
— The path of the value to delete.
Syntactic sugar for addOverride(path, undefined)
.
addDependency(target)
public addDependency(target: CfnResource): void
Parameters
- target
Cfn
Resource
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
addDependsOn(target)
public addDependsOn(target: CfnResource): void
⚠️ Deprecated: use addDependency
Parameters
- target
Cfn
Resource
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
addMetadata(key, value)
public addMetadata(key: string, value: any): void
Parameters
- key
string
- value
any
Add a value to the CloudFormation Resource Metadata.
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)
addOverride(path, value)
public addOverride(path: string, value: any): void
Parameters
- path
string
— - The path of the property, you can use dot notation to override values in complex types. - value
any
— - The value.
Adds an override to the synthesized CloudFormation resource.
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.
addPropertyDeletionOverride(propertyPath)
public addPropertyDeletionOverride(propertyPath: string): void
Parameters
- propertyPath
string
— The path to the property.
Adds an override that deletes the value of a property from the resource definition.
addPropertyOverride(propertyPath, value)
public addPropertyOverride(propertyPath: string, value: any): void
Parameters
- propertyPath
string
— The path of the property. - value
any
— The value.
Adds an override to a resource property.
Syntactic sugar for addOverride("Properties.<...>", value)
.
applyRemovalPolicy(policy?, options?)
public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void
Parameters
- policy
Removal
Policy - options
Removal
Policy Options
Sets the deletion policy of the resource based on the removal policy specified.
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:
getAtt(attributeName, typeHint?)
public getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Reference
Parameters
- attributeName
string
— The name of the attribute. - typeHint
Resolution
Type Hint
Returns
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. resource.arn
), but this can be used for future compatibility
in case there is no generated attribute.
getMetadata(key)
public getMetadata(key: string): any
Parameters
- key
string
Returns
any
Retrieve a value value from the CloudFormation Resource Metadata.
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)
inspect(inspector)
public inspect(inspector: TreeInspector): void
Parameters
- inspector
Tree
— tree inspector to collect and process attributes.Inspector
Examines the CloudFormation resource and discloses attributes.
obtainDependencies()
public obtainDependencies(): Stack | CfnResource[]
Returns
Stack
|
Cfn
Resource []
Retrieves an array of resources this resource depends on.
This assembles dependencies on resources across stacks (including nested stacks) automatically.
obtainResourceDependencies()
public obtainResourceDependencies(): CfnResource[]
Returns
Get a shallow copy of dependencies between this resource and other resources in the same stack.
overrideLogicalId(newLogicalId)
public overrideLogicalId(newLogicalId: string): void
Parameters
- newLogicalId
string
— The new logical ID to use for this stack element.
Overrides the auto-generated logical ID with a specific ID.
removeDependency(target)
public removeDependency(target: CfnResource): void
Parameters
- target
Cfn
Resource
Indicates that this resource no longer depends on another resource.
This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
replaceDependency(target, newTarget)
public replaceDependency(target: CfnResource, newTarget: CfnResource): void
Parameters
- target
Cfn
— The dependency to replace.Resource - newTarget
Cfn
— The new dependency to add.Resource
Replaces one dependency with another.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
protected renderProperties(props)
protected renderProperties(props: { [string]: any }): { [string]: any }
Parameters
- props
{ [string]: any }
Returns
{ [string]: any }