# NestedCloudAssemblyArtifact

Asset manifest is a description of a set of assets which need to be built and published.

Extends: CloudArtifact › NestedCloudAssemblyArtifact

- Source: [`cx-api/lib/legacy-moved.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/cx-api/lib/legacy-moved.ts#L534)
- Type last changed: v2.80.0 · 20 May 2023

## 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 nestedCloudAssemblyArtifact = new cx_api.NestedCloudAssemblyArtifact(cloudAssembly, 'name', {
  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,
  },
});
```

## Initializer

```ts
new NestedCloudAssemblyArtifact(assembly: CloudAssembly, name: string, artifact: ArtifactManifest)
```

## Properties

- `assembly`: [CloudAssembly](/cdk/api/v2/docs/aws-cdk-lib.cx_api.CloudAssembly.html) (required)

- `dependencies`: [CloudArtifact](/cdk/api/v2/docs/aws-cdk-lib.cx_api.CloudArtifact.html)[] (required) — Returns all the artifacts that this artifact depends on.

- `directoryName`: string (required) — The relative directory name of the asset manifest.

- `displayName`: string (required) — Display name.

- `fullPath`: string (required) — Full path to the nested assembly directory.

- `hierarchicalId`: string (required) — 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`: string (required)

- `manifest`: [ArtifactManifest](/cdk/api/v2/docs/aws-cdk-lib.cloud_assembly_schema.ArtifactManifest.html) (required) — The artifact's manifest.

- `messages`: [SynthesisMessage](/cdk/api/v2/docs/aws-cdk-lib.cx_api.SynthesisMessage.html)[] (required) — The set of messages extracted from the artifact's metadata.

- `metadata`: { [key: string]: [MetadataEntry](/cdk/api/v2/docs/aws-cdk-lib.cloud_assembly_schema.MetadataEntry.html)[] } (required) — Returns the metadata associated with this Cloud Artifact.

- `nestedAssembly`: [CloudAssembly](/cdk/api/v2/docs/aws-cdk-lib.cx_api.CloudAssembly.html) (required) — The nested Assembly.

## Methods

- `findMetadataByType(type: string): MetadataEntryResult[]`

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

- `fromManifest(assembly: CloudAssembly, id: string, artifact: ArtifactManifest): CloudArtifact` (static) — Returns a subclass of `CloudArtifact` based on the artifact type defined in the artifact manifest.

  **Parameters**

  - `assembly` — - The cloud assembly from which to load the artifact.
  - `id` — - The artifact ID.
  - `artifact` — - 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.

- `isNestedCloudAssemblyArtifact(art: any): boolean` (static) — Checks if `art` is an instance of this class.

  Use this method instead of `instanceof` to properly detect `NestedCloudAssemblyArtifact`
  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 `NestedCloudAssemblyArtifact` 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.
