# BundlingOutput

The type of output that a bundling operation is producing.

- Source: [`core/lib/bundling.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/core/lib/bundling.ts#L155)
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
import * as cdk from 'aws-cdk-lib';

const asset = new Asset(this, 'BundledAsset', {
  path: '/path/to/asset',
  bundling: {
    image: cdk.DockerImage.fromRegistry('alpine'),
    command: ['command-that-produces-an-archive.sh'],
    outputType: cdk.BundlingOutput.NOT_ARCHIVED, // Bundling output will be zipped even though it produces a single archive file.
  },
});
```

Python:

```python
import aws_cdk as cdk

asset = Asset(self, "BundledAsset",
    path="/path/to/asset",
    bundling=cdk.BundlingOptions(
        image=cdk.DockerImage.from_registry("alpine"),
        command=["command-that-produces-an-archive.sh"],
        output_type=cdk.BundlingOutput.NOT_ARCHIVED
    )
)
```

Java:

```java
import software.amazon.awscdk.*;

Asset asset = Asset.Builder.create(this, "BundledAsset")
        .path("/path/to/asset")
        .bundling(BundlingOptions.builder()
                .image(DockerImage.fromRegistry("alpine"))
                .command(List.of("command-that-produces-an-archive.sh"))
                .outputType(BundlingOutput.NOT_ARCHIVED)
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK;

var asset = new Asset(this, "BundledAsset", new AssetProps {
    Path = "/path/to/asset",
    Bundling = new BundlingOptions {
        Image = DockerImage.FromRegistry("alpine"),
        Command = new [] { "command-that-produces-an-archive.sh" },
        OutputType = BundlingOutput.NOT_ARCHIVED
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import "github.com/aws/aws-cdk-go/awscdk"

asset := awscdk.NewAsset(this, jsii.String("BundledAsset"), &AssetProps{
	Path: jsii.String("/path/to/asset"),
	Bundling: &BundlingOptions{
		Image: cdk.DockerImage_FromRegistry(jsii.String("alpine")),
		Command: []*string{
			jsii.String("command-that-produces-an-archive.sh"),
		},
		OutputType: cdk.BundlingOutput_NOT_ARCHIVED,
	},
})
```

## Members

| Member | Description |
| --- | --- |
| `ARCHIVED` | The bundling output directory includes a single .zip or .jar file which will be used as the final bundle. If the output directory does not include exactly a single archive, bundling will fail. |
| `NOT_ARCHIVED` | The bundling output directory contains one or more files which will be archived and uploaded as a .zip file to S3. |
| `AUTO_DISCOVER` | If the bundling output directory contains a single archive file (zip or jar) it will be used as the bundle output as-is. |
| `SINGLE_FILE` | The bundling output directory includes a single file which will be used as the final bundle. |

## Referenced by

- [`BundlingOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.BundlingOptions.html).outputType
