# CloudAssemblyBuilder

Can be used to build a cloud assembly.

Returned by: CloudAssemblyBuilder.createNestedAssembly

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

## Example

TypeScript:

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

declare const cloudAssemblyBuilder_: cx_api.CloudAssemblyBuilder;
const cloudAssemblyBuilder = new cx_api.CloudAssemblyBuilder(/* all optional props */ 'outdir', /* all optional props */ {
  assetOutdir: 'assetOutdir',
  parentBuilder: cloudAssemblyBuilder_,
});
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import cx_api

# cloud_assembly_builder_: cx_api.CloudAssemblyBuilder

cloud_assembly_builder = cx_api.CloudAssemblyBuilder("outdir",
    asset_outdir="assetOutdir",
    parent_builder=cloud_assembly_builder_
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cxapi.*;

CloudAssemblyBuilder cloudAssemblyBuilder_;

CloudAssemblyBuilder cloudAssemblyBuilder = CloudAssemblyBuilder.Builder.create("outdir")
        .assetOutdir("assetOutdir")
        .parentBuilder(cloudAssemblyBuilder_)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.CXAPI;

CloudAssemblyBuilder cloudAssemblyBuilder_;

var cloudAssemblyBuilder = new CloudAssemblyBuilder("outdir", new CloudAssemblyBuilderProps {
    AssetOutdir = "assetOutdir",
    ParentBuilder = cloudAssemblyBuilder_
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var cloudAssemblyBuilder_ CloudAssemblyBuilder

cloudAssemblyBuilder := awscdk.Cx_api.NewCloudAssemblyBuilder(jsii.String("outdir"), &CloudAssemblyBuilderProps{
	AssetOutdir: jsii.String("assetOutdir"),
	ParentBuilder: cloudAssemblyBuilder_,
})
```

## Initializer

TypeScript:

```ts
new CloudAssemblyBuilder(outdir?: string, props?: CloudAssemblyBuilderProps)
```

Python:

```python
CloudAssemblyBuilder(outdir: typing.Optional[str] = None, props: typing.Optional[CloudAssemblyBuilderProps] = None)
```

Java:

```java
new CloudAssemblyBuilder(String outdir, CloudAssemblyBuilderProps props)
```

C# / .NET:

```csharp
new CloudAssemblyBuilder(string? outdir = null, CloudAssemblyBuilderProps? props = null)
```

Golang:

```go
NewCloudAssemblyBuilder(Outdir *string, Props CloudAssemblyBuilderProps)
```

## Properties

- `assetOutdir`: string — The directory where assets of this Cloud Assembly should be stored.

- `outdir`: string — The root directory of the resulting cloud assembly.

## Methods

- `addArtifact(id: string, manifest: ArtifactManifest): void` — Adds an artifact into the cloud assembly.

  **Parameters**

  - `id` — - The ID of the artifact.
  - `manifest` — - The artifact manifest.

- `addMissing(missing: MissingContext): void` — Reports that some context is missing in order for this cloud assembly to be fully synthesized.

  **Parameters**

  - `missing` — - Missing context information.

- `buildAssembly(options?: AssemblyBuildOptions): CloudAssembly` — Finalizes the cloud assembly into the output directory returns a `CloudAssembly` object that can be used to inspect the assembly.

- `createNestedAssembly(artifactId: string, displayName: string): CloudAssemblyBuilder // chainable` — Creates a nested cloud assembly.

- `delete(): void` — Delete the cloud assembly directory.
