Table of Contents

Class BundlingOptions

Namespace
Amazon.CDK
Assembly
Amazon.CDK.dll

Bundling options.

public class BundlingOptions : IBundlingOptions
Inheritance
BundlingOptions
Implements
Inherited Members

Examples

var asset = new Asset(this, "BundledAsset", new AssetProps {
                Path = Join(__dirname, "markdown-asset"),  // /asset-input and working directory in the container
                Bundling = new BundlingOptions {
                    Image = DockerImage.FromBuild(Join(__dirname, "alpine-markdown")),  // Build an image
                    Command = new [] { "sh", "-c", @"
                                    markdown index.md > /asset-output/index.html
                                  " }
                }
            });

Remarks

ExampleMetadata: lit=test/integ.assets.bundling.lit.ts infused

Constructors

BundlingOptions()

public BundlingOptions()

Properties

Command

The command to run in the Docker container.

public string[]? Command { get; set; }

Property Value

string[]

Remarks

Example value: ['npm', 'install']

Default: - run the command defined in the image

See: https://docs.docker.com/engine/reference/run/

Entrypoint

The entrypoint to run in the Docker container.

public string[]? Entrypoint { get; set; }

Property Value

string[]

Remarks

Example value: ['/bin/sh', '-c']

Default: - run the entrypoint defined in the image

See: https://docs.docker.com/engine/reference/builder/#entrypoint

Environment

The environment variables to pass to the Docker container.

public IDictionary<string, string>? Environment { get; set; }

Property Value

IDictionary<string, string>

Remarks

Default: - no environment variables.

Image

The Docker image where the command will run.

public DockerImage Image { get; set; }

Property Value

DockerImage

Local

Local bundling provider.

public ILocalBundling? Local { get; set; }

Property Value

ILocalBundling

Remarks

The provider implements a method tryBundle() which should return true if local bundling was performed. If false is returned, docker bundling will be done.

Default: - bundling will only be performed in a Docker container

OutputType

The type of output that this bundling operation is producing.

public BundlingOutput? OutputType { get; set; }

Property Value

BundlingOutput?

Remarks

Default: BundlingOutput.AUTO_DISCOVER

SecurityOpt

Security configuration when running the docker container.

public string? SecurityOpt { get; set; }

Property Value

string

Remarks

Default: - no security options

User

The user to use when running the Docker container.

public string? User { get; set; }

Property Value

string

Remarks

user | user:group | uid | uid:gid | user:gid | uid:group

Default: - uid:gid of the current user or 1000:1000 on Windows

See: https://docs.docker.com/engine/reference/run/#user

Volumes

Additional Docker volumes to mount.

public IDockerVolume[]? Volumes { get; set; }

Property Value

IDockerVolume[]

Remarks

Default: - no additional volumes are mounted

WorkingDirectory

Working directory inside the Docker container.

public string? WorkingDirectory { get; set; }

Property Value

string

Remarks

Default: /asset-input