@aws-cdk_cx-api.CloudFormationStackArtifact

class CloudFormationStackArtifact

LanguageType name
.NETAmazon.CDK.CXAPI.CloudFormationStackArtifact
Javasoftware.amazon.awscdk.cxapi.CloudFormationStackArtifact
Pythonaws_cdk.cx_api.CloudFormationStackArtifact
TypeScript (source)@aws-cdk/cx-api » CloudFormationStackArtifact

Extends CloudArtifact

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 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
    assumeRoleArn: 'assumeRoleArn',
    assumeRoleExternalId: 'assumeRoleExternalId',
    bootstrapStackVersionSsmParameter: 'bootstrapStackVersionSsmParameter',
    cloudFormationExecutionRoleArn: 'cloudFormationExecutionRoleArn',
    lookupRole: {
      arn: 'arn',

      // the properties below are optional
      assumeRoleExternalId: 'assumeRoleExternalId',
      bootstrapStackVersionSsmParameter: 'bootstrapStackVersionSsmParameter',
      requiresBootstrapStackVersion: 123,
    },
    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 CloudAssembly
  • artifactId string
  • artifact ArtifactManifest

Properties

NameTypeDescription
assemblyCloudAssembly
assetsFileAssetMetadataEntry | ContainerImageAssetMetadataEntry[]Any assets associated with this stack.
dependenciesCloudArtifact[]Returns all the artifacts that this artifact depends on.
displayNamestringA string that represents this stack.
environmentEnvironmentThe environment into which to deploy this artifact.
hierarchicalIdstringAn identifier that shows where this artifact is located in the tree of nested assemblies, based on their manifests.
idstring
manifestArtifactManifestThe artifact's manifest.
messagesSynthesisMessage[]The set of messages extracted from the artifact's metadata.
name⚠️stringThe physical name of this stack.
originalNamestringThe original name as defined in the CDK app.
parameters{ [string]: string }CloudFormation parameters to pass to the stack.
stackNamestringThe physical name of this stack.
tags{ [string]: string }CloudFormation tags to pass to the stack.
templateanyThe CloudFormation template for this stack.
templateFilestringThe file name of the template.
templateFullPathstringFull path to the template file.
assumeRoleArn?stringThe role that needs to be assumed to deploy the stack.
assumeRoleExternalId?stringExternal ID to use when assuming role for cloudformation deployments.
bootstrapStackVersionSsmParameter?stringName of SSM parameter with bootstrap stack version.
cloudFormationExecutionRoleArn?stringThe role that is passed to CloudFormation to execute the change set.
lookupRole?BootstrapRoleThe role to use to look up values from the target AWS account.
requiresBootstrapStackVersion?numberVersion of bootstrap stack required to deploy this stack.
stackTemplateAssetObjectUrl?stringIf the stack template has already been included in the asset manifest, its asset URL.
terminationProtection?booleanWhether termination protection is enabled for this stack.
validateOnSynth?booleanWhether this stack should be validated by the CLI after synthesis.

assembly

Type: CloudAssembly


assets

Type: FileAssetMetadataEntry | ContainerImageAssetMetadataEntry[]

Any assets associated with this stack.


dependencies

Type: CloudArtifact[]

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 " ()"


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: ArtifactManifest

The artifact's manifest.


messages

Type: SynthesisMessage[]

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.


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: BootstrapRole (optional, default: No role is assumed (current credentials are used))

The role to use to look up values from the target AWS account.


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

NameDescription
findMetadataByType(type)
static isCloudFormationStackArtifact(art)Checks if art is an instance of this class.

findMetadataByType(type)

public findMetadataByType(type: string): MetadataEntryResult[]

Parameters

  • type string

Returns

  • MetadataEntryResult[]

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.