Skip to content
v2.274.0

CloudArtifact Class ​

Represents an artifact within a cloud assembly.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { cloud_assembly_schema } from 'aws-cdk-lib';
import { cx_api } from 'aws-cdk-lib';

declare const assumeRoleAdditionalOptions: any;
declare const cloudAssembly: cx_api.CloudAssembly;
const cloudArtifact = cx_api.CloudArtifact.fromManifest(cloudAssembly, 'MyCloudArtifact', {
  type: cloud_assembly_schema.ArtifactType.NONE,

  // the properties below are optional
  additionalMetadataFile: 'additionalMetadataFile',
  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,
  },
});

Properties ​

assemblyCloudAssemblyassemblyCloudAssemblyassemblyCloudAssemblyAssemblyCloudAssemblyAssemblyCloudAssemblyrequired#
dependenciesCloudArtifact[]dependenciestyping.List[CloudArtifact]dependenciesList<CloudArtifact>DependenciesCloudArtifact[]Dependencies*[]CloudArtifactrequired#
Returns all the artifacts that this artifact depends on.
hierarchicalIdstringhierarchical_idstrhierarchicalIdStringHierarchicalIdstringHierarchicalId*stringrequired#
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.

idstringidstridStringIdstringId*stringrequired#
The artifact's manifest.
messagesSynthesisMessage[]messagestyping.List[SynthesisMessage]messagesList<SynthesisMessage>MessagesSynthesisMessage[]Messages*[]SynthesisMessagerequired#
The set of messages extracted from the artifact's metadata.
metadata{ [key: string]: MetadataEntry[] }metadatatyping.Mapping[str, typing.List[MetadataEntry]]metadataMap<String, List<MetadataEntry>>MetadataIDictionary<string, MetadataEntry[]>Metadata*map[string]*[]MetadataEntryrequired#
Returns the metadata associated with this Cloud Artifact.

Methods ​

findMetadataByType(type: string): MetadataEntryResult[]def find_metadata_by_type(self, type: str) -> typing.List[MetadataEntryResult]public List<MetadataEntryResult> findMetadataByType(String type)public MetadataEntryResult[] FindMetadataByType(string type)func FindMetadataByType(Type *string) *[]MetadataEntryResult#
returns

Returns: all the metadata entries of a specific type in this artifact.

fromManifest(assembly: CloudAssembly, id: string, artifact: ArtifactManifest): CloudArtifact // chainable@staticmethod def from_manifest(assembly: CloudAssembly, id: str, artifact: ArtifactManifest) -> CloudArtifactpublic static CloudArtifact fromManifest(CloudAssembly assembly, String id, ArtifactManifest artifact)public static CloudArtifact FromManifest(CloudAssembly assembly, string id, ArtifactManifest artifact)func FromManifest(Assembly CloudAssembly, Id *string, Artifact ArtifactManifest) CloudArtifactstatic#
Returns a subclass of `CloudArtifact` based on the artifact type defined in the artifact manifest.
3 parameters · returns

Parameters

  • assemblyassemblyassemblyassemblyAssembly — - The cloud assembly from which to load the artifact.
  • ididididId — - The artifact ID.
  • artifactartifactartifactartifactArtifact — - The artifact manifest.

Returns: the CloudArtifact that matches the artifact type or undefined if it's an artifact type that is unrecognized by this module.