class CloudFormationStackArtifact
Language | Type name |
---|---|
![]() | Amazon.CDK.CXAPI.CloudFormationStackArtifact |
![]() | software.amazon.awscdk.cxapi.CloudFormationStackArtifact |
![]() | aws_cdk.cx_api.CloudFormationStackArtifact |
![]() | @aws-cdk/cx-api » CloudFormationStackArtifact |
Extends
Cloud
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cloud_assembly_schema from '@aws-cdk/cloud-assembly-schema';
import * as cx_api from '@aws-cdk/cx-api';
declare const assumeRoleAdditionalOptions: any;
declare const cloudAssembly: cx_api.CloudAssembly;
const cloudFormationStackArtifact = new cx_api.CloudFormationStackArtifact(cloudAssembly, 'artifactId', {
type: cloud_assembly_schema.ArtifactType.NONE,
// the properties below are optional
dependencies: ['dependencies'],
displayName: 'displayName',
environment: 'environment',
metadata: {
metadataKey: [{
type: 'type',
// the properties below are optional
data: 'data',
trace: ['trace'],
}],
},
properties: {
templateFile: 'templateFile',
// the properties below are optional
assumeRoleAdditionalOptions: {
assumeRoleAdditionalOptionsKey: assumeRoleAdditionalOptions,
},
assumeRoleArn: 'assumeRoleArn',
assumeRoleExternalId: 'assumeRoleExternalId',
bootstrapStackVersionSsmParameter: 'bootstrapStackVersionSsmParameter',
cloudFormationExecutionRoleArn: 'cloudFormationExecutionRoleArn',
lookupRole: {
arn: 'arn',
// the properties below are optional
assumeRoleAdditionalOptions: {
assumeRoleAdditionalOptionsKey: assumeRoleAdditionalOptions,
},
assumeRoleExternalId: 'assumeRoleExternalId',
bootstrapStackVersionSsmParameter: 'bootstrapStackVersionSsmParameter',
requiresBootstrapStackVersion: 123,
},
notificationArns: ['notificationArns'],
parameters: {
parametersKey: 'parameters',
},
requiresBootstrapStackVersion: 123,
stackName: 'stackName',
stackTemplateAssetObjectUrl: 'stackTemplateAssetObjectUrl',
tags: {
tagsKey: 'tags',
},
terminationProtection: false,
validateOnSynth: false,
},
});
Initializer
new CloudFormationStackArtifact(assembly: CloudAssembly, artifactId: string, artifact: ArtifactManifest)
Parameters
- assembly
Cloud
Assembly - artifactId
string
- artifact
Artifact
Manifest
Properties
Name | Type | Description |
---|---|---|
assembly | Cloud | |
assets | File | Container [] | Any assets associated with this stack. |
dependencies | Cloud [] | Returns all the artifacts that this artifact depends on. |
display | string | A string that represents this stack. |
environment | Environment | The environment into which to deploy this artifact. |
hierarchical | string | An identifier that shows where this artifact is located in the tree of nested assemblies, based on their manifests. |
id | string | |
manifest | Artifact | The artifact's manifest. |
messages | Synthesis [] | The set of messages extracted from the artifact's metadata. |
name | string | The physical name of this stack. |
original | string | The original name as defined in the CDK app. |
parameters | { [string]: string } | CloudFormation parameters to pass to the stack. |
stack | string | The physical name of this stack. |
tags | { [string]: string } | CloudFormation tags to pass to the stack. |
template | any | The CloudFormation template for this stack. |
template | string | The file name of the template. |
template | string | Full path to the template file. |
assume | { [string]: any } | Additional options to pass to STS when assuming the role for cloudformation deployments. |
assume | string | The role that needs to be assumed to deploy the stack. |
assume | string | External ID to use when assuming role for cloudformation deployments. |
bootstrap | string | Name of SSM parameter with bootstrap stack version. |
cloud | string | The role that is passed to CloudFormation to execute the change set. |
lookup | Bootstrap | The role to use to look up values from the target AWS account. |
notification | string[] | SNS Topics that will receive stack events. |
requires | number | Version of bootstrap stack required to deploy this stack. |
stack | string | If the stack template has already been included in the asset manifest, its asset URL. |
termination | boolean | Whether termination protection is enabled for this stack. |
validate | boolean | Whether this stack should be validated by the CLI after synthesis. |
assembly
Type:
Cloud
assets
Type:
File
|
Container
[]
Any assets associated with this stack.
dependencies
Type:
Cloud
[]
Returns all the artifacts that this artifact depends on.
displayName
Type:
string
A string that represents this stack.
Should only be used in user interfaces. If the stackName has not been set explicitly, or has been set to artifactId, it will return the hierarchicalId of the stack. Otherwise, it will return something like "<hierarchicalId> (<stackName>)"
environment
Type:
Environment
The environment into which to deploy this artifact.
hierarchicalId
Type:
string
An identifier that shows where this artifact is located in the tree of nested assemblies, based on their manifests.
Defaults to the normal id. Should only be used in user interfaces.
id
Type:
string
manifest
Type:
Artifact
The artifact's manifest.
messages
Type:
Synthesis
[]
The set of messages extracted from the artifact's metadata.
name
⚠️ Deprecated: renamed to stackName
Type:
string
The physical name of this stack.
originalName
Type:
string
The original name as defined in the CDK app.
parameters
Type:
{ [string]: string }
CloudFormation parameters to pass to the stack.
stackName
Type:
string
The physical name of this stack.
tags
Type:
{ [string]: string }
CloudFormation tags to pass to the stack.
template
Type:
any
The CloudFormation template for this stack.
templateFile
Type:
string
The file name of the template.
templateFullPath
Type:
string
Full path to the template file.
assumeRoleAdditionalOptions?
Type:
{ [string]: any }
(optional, default: No additional options.)
Additional options to pass to STS when assuming the role for cloudformation deployments.
RoleArn
should not be used. Use the dedicatedassumeRoleArn
property instead.ExternalId
should not be used. Use the dedicatedassumeRoleExternalId
instead.TransitiveTagKeys
defaults to use all keys (if any) specified inTags
. E.g, all tags are transitive by default.
assumeRoleArn?
Type:
string
(optional, default: No role is assumed (current credentials are used))
The role that needs to be assumed to deploy the stack.
assumeRoleExternalId?
Type:
string
(optional, default: No external ID)
External ID to use when assuming role for cloudformation deployments.
bootstrapStackVersionSsmParameter?
Type:
string
(optional, default: Discover SSM parameter by reading stack)
Name of SSM parameter with bootstrap stack version.
cloudFormationExecutionRoleArn?
Type:
string
(optional, default: No role is passed (currently assumed role/credentials are used))
The role that is passed to CloudFormation to execute the change set.
lookupRole?
Type:
Bootstrap
(optional, default: No role is assumed (current credentials are used))
The role to use to look up values from the target AWS account.
notificationArns?
Type:
string[]
(optional)
SNS Topics that will receive stack events.
requiresBootstrapStackVersion?
Type:
number
(optional, default: No bootstrap stack required)
Version of bootstrap stack required to deploy this stack.
stackTemplateAssetObjectUrl?
Type:
string
(optional, default: Not uploaded yet, upload just before deploying)
If the stack template has already been included in the asset manifest, its asset URL.
terminationProtection?
Type:
boolean
(optional)
Whether termination protection is enabled for this stack.
validateOnSynth?
Type:
boolean
(optional, default: false)
Whether this stack should be validated by the CLI after synthesis.
Methods
Name | Description |
---|---|
find | |
static is | Checks if art is an instance of this class. |
findMetadataByType(type)
public findMetadataByType(type: string): MetadataEntryResult[]
Parameters
- type
string
Returns
static isCloudFormationStackArtifact(art)
public static isCloudFormationStackArtifact(art: any): boolean
Parameters
- art
any
Returns
boolean
Checks if art
is an instance of this class.
Use this method instead of instanceof
to properly detect CloudFormationStackArtifact
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the cx-api
library on
disk are seen as independent, completely different libraries. As a
consequence, the class CloudFormationStackArtifact
in each copy of the cx-api
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 cx-api
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.