class CfnTable (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.DynamoDB.CfnTable |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsdynamodb#CfnTable |
![]() | software.amazon.awscdk.services.dynamodb.CfnTable |
![]() | aws_cdk.aws_dynamodb.CfnTable |
![]() | aws-cdk-lib » aws_dynamodb » CfnTable |
Implements
IConstruct
, IDependable
, IInspectable
, ITaggable
The AWS::DynamoDB::Table
resource creates a DynamoDB table. For more information, see CreateTable in the Amazon DynamoDB API Reference .
You should be aware of the following behaviors when working with DynamoDB tables:
- AWS CloudFormation typically creates DynamoDB tables in parallel. However, if your template includes multiple DynamoDB tables with indexes, you must declare dependencies so that the tables are created sequentially. Amazon DynamoDB limits the number of tables with secondary indexes that are in the creating state. If you create multiple tables with indexes at the same time, DynamoDB returns an error and the stack operation fails. For an example, see DynamoDB Table with a DependsOn Attribute .
Our guidance is to use the latest schema documented for your AWS CloudFormation templates. This schema supports the provisioning of all table settings below. When using this schema in your AWS CloudFormation templates, please ensure that your Identity and Access Management ( IAM ) policies are updated with appropriate permissions to allow for the authorization of these setting changes.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.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 cfnTable = new dynamodb.CfnTable(this, 'MyCfnTable', {
keySchema: [{
attributeName: 'attributeName',
keyType: 'keyType',
}],
// the properties below are optional
attributeDefinitions: [{
attributeName: 'attributeName',
attributeType: 'attributeType',
}],
billingMode: 'billingMode',
contributorInsightsSpecification: {
enabled: false,
},
deletionProtectionEnabled: false,
globalSecondaryIndexes: [{
indexName: 'indexName',
keySchema: [{
attributeName: 'attributeName',
keyType: 'keyType',
}],
projection: {
nonKeyAttributes: ['nonKeyAttributes'],
projectionType: 'projectionType',
},
// the properties below are optional
contributorInsightsSpecification: {
enabled: false,
},
onDemandThroughput: {
maxReadRequestUnits: 123,
maxWriteRequestUnits: 123,
},
provisionedThroughput: {
readCapacityUnits: 123,
writeCapacityUnits: 123,
},
warmThroughput: {
readUnitsPerSecond: 123,
writeUnitsPerSecond: 123,
},
}],
importSourceSpecification: {
inputFormat: 'inputFormat',
s3BucketSource: {
s3Bucket: 's3Bucket',
// the properties below are optional
s3BucketOwner: 's3BucketOwner',
s3KeyPrefix: 's3KeyPrefix',
},
// the properties below are optional
inputCompressionType: 'inputCompressionType',
inputFormatOptions: {
csv: {
delimiter: 'delimiter',
headerList: ['headerList'],
},
},
},
kinesisStreamSpecification: {
streamArn: 'streamArn',
// the properties below are optional
approximateCreationDateTimePrecision: 'approximateCreationDateTimePrecision',
},
localSecondaryIndexes: [{
indexName: 'indexName',
keySchema: [{
attributeName: 'attributeName',
keyType: 'keyType',
}],
projection: {
nonKeyAttributes: ['nonKeyAttributes'],
projectionType: 'projectionType',
},
}],
onDemandThroughput: {
maxReadRequestUnits: 123,
maxWriteRequestUnits: 123,
},
pointInTimeRecoverySpecification: {
pointInTimeRecoveryEnabled: false,
recoveryPeriodInDays: 123,
},
provisionedThroughput: {
readCapacityUnits: 123,
writeCapacityUnits: 123,
},
resourcePolicy: {
policyDocument: policyDocument,
},
sseSpecification: {
sseEnabled: false,
// the properties below are optional
kmsMasterKeyId: 'kmsMasterKeyId',
sseType: 'sseType',
},
streamSpecification: {
streamViewType: 'streamViewType',
// the properties below are optional
resourcePolicy: {
policyDocument: policyDocument,
},
},
tableClass: 'tableClass',
tableName: 'tableName',
tags: [{
key: 'key',
value: 'value',
}],
timeToLiveSpecification: {
enabled: false,
// the properties below are optional
attributeName: 'attributeName',
},
warmThroughput: {
readUnitsPerSecond: 123,
writeUnitsPerSecond: 123,
},
});
Initializer
new CfnTable(scope: Construct, id: string, props: CfnTableProps)
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.Table Props
Construct Props
Name | Type | Description |
---|---|---|
key | IResolvable | IResolvable | Key [] | Specifies the attributes that make up the primary key for the table. |
attribute | IResolvable | IResolvable | Attribute [] | A list of attributes that describe the key schema for the table and indexes. |
billing | string | Specify how you are charged for read and write throughput and how you manage capacity. |
contributor | IResolvable | Contributor | The settings used to enable or disable CloudWatch Contributor Insights for the specified table. |
deletion | boolean | IResolvable | Determines if a table is protected from deletion. |
global | IResolvable | IResolvable | Global [] | Global secondary indexes to be created on the table. You can create up to 20 global secondary indexes. |
import | IResolvable | Import | Specifies the properties of data being imported from the S3 bucket source to the" table. |
kinesis | IResolvable | Kinesis | The Kinesis Data Streams configuration for the specified table. |
local | IResolvable | IResolvable | Local [] | Local secondary indexes to be created on the table. |
on | IResolvable | On | Sets the maximum number of read and write units for the specified on-demand table. |
point | IResolvable | Point | The settings used to enable point in time recovery. |
provisioned | IResolvable | Provisioned | Throughput for the specified table, which consists of values for ReadCapacityUnits and WriteCapacityUnits . |
resource | IResolvable | Resource | A resource-based policy document that contains permissions to add to the specified table. |
sse | IResolvable | SSESpecification | Specifies the settings to enable server-side encryption. |
stream | IResolvable | Stream | The settings for the DynamoDB table stream, which capture changes to items stored in the table. |
table | string | The table class of the new table. |
table | string | A name for the table. |
tags? | Cfn [] | An array of key-value pairs to apply to this resource. |
time | IResolvable | Time | Specifies the Time to Live (TTL) settings for the table. |
warm | IResolvable | Warm | Represents the warm throughput (in read units per second and write units per second) for creating a table. |
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.
attributeDefinitions?
Type:
IResolvable
|
IResolvable
|
Attribute
[]
(optional)
A list of attributes that describe the key schema for the table and indexes.
This property is required to create a DynamoDB table.
Update requires: Some interruptions . Replacement if you edit an existing AttributeDefinition.
billingMode?
Type:
string
(optional)
Specify how you are charged for read and write throughput and how you manage capacity.
Valid values include:
PROVISIONED
- We recommend usingPROVISIONED
for predictable workloads.PROVISIONED
sets the billing mode to Provisioned Mode .PAY_PER_REQUEST
- We recommend usingPAY_PER_REQUEST
for unpredictable workloads.PAY_PER_REQUEST
sets the billing mode to On-Demand Mode .
If not specified, the default is PROVISIONED
.
contributorInsightsSpecification?
Type:
IResolvable
|
Contributor
(optional)
The settings used to enable or disable CloudWatch Contributor Insights for the specified table.
deletionProtectionEnabled?
Type:
boolean |
IResolvable
(optional)
Determines if a table is protected from deletion.
When enabled, the table cannot be deleted by any user or process. This setting is disabled by default. For more information, see Using deletion protection in the Amazon DynamoDB Developer Guide .
globalSecondaryIndexes?
Type:
IResolvable
|
IResolvable
|
Global
[]
(optional)
Global secondary indexes to be created on the table. You can create up to 20 global secondary indexes.
If you update a table to include a new global secondary index, AWS CloudFormation initiates the index creation and then proceeds with the stack update. AWS CloudFormation doesn't wait for the index to complete creation because the backfilling phase can take a long time, depending on the size of the table. You can't use the index or update the table until the index's status is
ACTIVE
. You can track its status by using the DynamoDB DescribeTable command.If you add or delete an index 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 index, you must manually delete the index.
Updates are not supported. The following are exceptions:
- If you update either the contributor insights specification or the provisioned throughput values of global secondary indexes, you can update the table without interruption.
- You can delete or add one global secondary index without interruption. If you do both in the same update (for example, by changing the index's logical ID), the update fails.
importSourceSpecification?
Type:
IResolvable
|
Import
(optional)
Specifies the properties of data being imported from the S3 bucket source to the" table.
If you specify the
ImportSourceSpecification
property, and also specify either theStreamSpecification
, theTableClass
property, theDeletionProtectionEnabled
property, or theWarmThroughput
property, the IAM entity creating/updating stack must haveUpdateTable
permission.
kinesisStreamSpecification?
Type:
IResolvable
|
Kinesis
(optional)
The Kinesis Data Streams configuration for the specified table.
localSecondaryIndexes?
Type:
IResolvable
|
IResolvable
|
Local
[]
(optional)
Local secondary indexes to be created on the table.
You can create up to 5 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.
onDemandThroughput?
Type:
IResolvable
|
On
(optional)
Sets the maximum number of read and write units for the specified on-demand table.
If you use this property, you must specify MaxReadRequestUnits
, MaxWriteRequestUnits
, or both.
pointInTimeRecoverySpecification?
Type:
IResolvable
|
Point
(optional)
The settings used to enable point in time recovery.
provisionedThroughput?
Type:
IResolvable
|
Provisioned
(optional)
Throughput for the specified table, which consists of values for ReadCapacityUnits
and WriteCapacityUnits
.
For more information about the contents of a provisioned throughput structure, see Amazon DynamoDB Table ProvisionedThroughput .
If you set BillingMode
as PROVISIONED
, you must specify this property. If you set BillingMode
as PAY_PER_REQUEST
, you cannot specify this property.
resourcePolicy?
Type:
IResolvable
|
Resource
(optional)
A resource-based policy document that contains permissions to add to the specified table.
In a CloudFormation template, you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to DynamoDB . For more information about resource-based policies, see Using resource-based policies for DynamoDB and Resource-based policy examples .
When you attach a resource-based policy while creating a table, the policy creation is strongly consistent . For information about the considerations that you should keep in mind while attaching a resource-based policy, see Resource-based policy considerations .
sseSpecification?
Type:
IResolvable
|
SSESpecification
(optional)
Specifies the settings to enable server-side encryption.
streamSpecification?
Type:
IResolvable
|
Stream
(optional)
The settings for the DynamoDB table stream, which capture changes to items stored in the table.
tableClass?
Type:
string
(optional)
The table class of the new table.
Valid values are STANDARD
and STANDARD_INFREQUENT_ACCESS
.
tableName?
Type:
string
(optional)
A name for the table.
If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for 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.
tags?
Type:
Cfn
[]
(optional)
An array of key-value pairs to apply to this resource.
For more information, see Tag .
timeToLiveSpecification?
Type:
IResolvable
|
Time
(optional)
Specifies the Time to Live (TTL) settings for the table.
For detailed information about the limits in DynamoDB, see Limits in Amazon DynamoDB in the Amazon DynamoDB Developer Guide.
warmThroughput?
Type:
IResolvable
|
Warm
(optional)
Represents the warm throughput (in read units per second and write units per second) for creating a table.
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 . |
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. |
stack | Stack | The stack in which this element is defined. |
tags | Tag | Tag Manager which manages the tags for this resource. |
attribute | IResolvable | IResolvable | Attribute [] | A list of attributes that describe the key schema for the table and indexes. |
billing | string | Specify how you are charged for read and write throughput and how you manage capacity. |
contributor | IResolvable | Contributor | The settings used to enable or disable CloudWatch Contributor Insights for the specified table. |
deletion | boolean | IResolvable | Determines if a table is protected from deletion. |
global | IResolvable | IResolvable | Global [] | Global secondary indexes to be created on the table. |
import | IResolvable | Import | Specifies the properties of data being imported from the S3 bucket source to the" table. |
kinesis | IResolvable | Kinesis | The Kinesis Data Streams configuration for the specified table. |
local | IResolvable | IResolvable | Local [] | Local secondary indexes to be created on the table. |
on | IResolvable | On | Sets the maximum number of read and write units for the specified on-demand table. |
point | IResolvable | Point | The settings used to enable point in time recovery. |
provisioned | IResolvable | Provisioned | Throughput for the specified table, which consists of values for ReadCapacityUnits and WriteCapacityUnits . |
resource | IResolvable | Resource | A resource-based policy document that contains permissions to add to the specified table. |
sse | IResolvable | SSESpecification | Specifies the settings to enable server-side encryption. |
stream | IResolvable | Stream | The settings for the DynamoDB table stream, which capture changes to items stored in the table. |
table | string | The table class of the new table. |
table | string | A name for the table. |
tags | Cfn [] | An array of key-value pairs to apply to this resource. |
time | IResolvable | Time | Specifies the Time to Live (TTL) settings for the table. |
warm | IResolvable | Warm | Represents the warm throughput (in read units per second and write units per second) for creating a table. |
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
.
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
.
You must specify the
StreamSpecification
property to use this attribute.
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 })
.
stack
Type:
Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
tags
Type:
Tag
Tag Manager which manages the tags for this resource.
attributeDefinitions?
Type:
IResolvable
|
IResolvable
|
Attribute
[]
(optional)
A list of attributes that describe the key schema for the table and indexes.
billingMode?
Type:
string
(optional)
Specify how you are charged for read and write throughput and how you manage capacity.
contributorInsightsSpecification?
Type:
IResolvable
|
Contributor
(optional)
The settings used to enable or disable CloudWatch Contributor Insights for the specified table.
deletionProtectionEnabled?
Type:
boolean |
IResolvable
(optional)
Determines if a table is protected from deletion.
globalSecondaryIndexes?
Type:
IResolvable
|
IResolvable
|
Global
[]
(optional)
Global secondary indexes to be created on the table.
You can create up to 20 global secondary indexes.
importSourceSpecification?
Type:
IResolvable
|
Import
(optional)
Specifies the properties of data being imported from the S3 bucket source to the" table.
kinesisStreamSpecification?
Type:
IResolvable
|
Kinesis
(optional)
The Kinesis Data Streams configuration for the specified table.
localSecondaryIndexes?
Type:
IResolvable
|
IResolvable
|
Local
[]
(optional)
Local secondary indexes to be created on the table.
onDemandThroughput?
Type:
IResolvable
|
On
(optional)
Sets the maximum number of read and write units for the specified on-demand table.
pointInTimeRecoverySpecification?
Type:
IResolvable
|
Point
(optional)
The settings used to enable point in time recovery.
provisionedThroughput?
Type:
IResolvable
|
Provisioned
(optional)
Throughput for the specified table, which consists of values for ReadCapacityUnits
and WriteCapacityUnits
.
resourcePolicy?
Type:
IResolvable
|
Resource
(optional)
A resource-based policy document that contains permissions to add to the specified table.
sseSpecification?
Type:
IResolvable
|
SSESpecification
(optional)
Specifies the settings to enable server-side encryption.
streamSpecification?
Type:
IResolvable
|
Stream
(optional)
The settings for the DynamoDB table stream, which capture changes to items stored in the table.
tableClass?
Type:
string
(optional)
The table class of the new table.
tableName?
Type:
string
(optional)
A name for the table.
tagsRaw?
Type:
Cfn
[]
(optional)
An array of key-value pairs to apply to this resource.
timeToLiveSpecification?
Type:
IResolvable
|
Time
(optional)
Specifies the Time to Live (TTL) settings for the table.
warmThroughput?
Type:
IResolvable
|
Warm
(optional)
Represents the warm throughput (in read units per second and write units per second) for creating a table.
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 }