@aws-cdk_cx-api.TreeCloudArtifact

class TreeCloudArtifact

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

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 treeCloudArtifact = new cx_api.TreeCloudArtifact(cloudAssembly, 'name', {
  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 TreeCloudArtifact(assembly: CloudAssembly, name: string, artifact: ArtifactManifest)

Parameters

  • assembly CloudAssembly
  • name string
  • artifact ArtifactManifest

Properties

NameTypeDescription
assemblyCloudAssembly
dependenciesCloudArtifact[]Returns all the artifacts that this artifact depends on.
filestring
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.

assembly

Type: CloudAssembly


dependencies

Type: CloudArtifact[]

Returns all the artifacts that this artifact depends on.


file

Type: string


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.

Methods

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

findMetadataByType(type)

public findMetadataByType(type: string): MetadataEntryResult[]

Parameters

  • type string

Returns

  • MetadataEntryResult[]

static isTreeCloudArtifact(art)

public static isTreeCloudArtifact(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 TreeCloudArtifact 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 TreeCloudArtifact 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.