interface BundlingOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.BundlingOptions |
Go | github.com/aws/aws-cdk-go/awscdk/v2#BundlingOptions |
Java | software.amazon.awscdk.BundlingOptions |
Python | aws_cdk.BundlingOptions |
TypeScript (source) | aws-cdk-lib » BundlingOptions |
Bundling options.
Example
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.
},
});
Properties
Name | Type | Description |
---|---|---|
image | Docker | The Docker image where the command will run. |
bundling | Bundling | The access mechanism used to make source files available to the bundling container and to return the bundling output back to the host. |
command? | string[] | The command to run in the Docker container. |
entrypoint? | string[] | The entrypoint to run in the Docker container. |
environment? | { [string]: string } | The environment variables to pass to the Docker container. |
local? | ILocal | Local bundling provider. |
network? | string | Docker Networking options. |
output | Bundling | The type of output that this bundling operation is producing. |
platform? | string | Platform to build for. Requires Docker Buildx. |
security | string | Security configuration when running the docker container. |
user? | string | The user to use when running the Docker container. |
volumes? | Docker [] | Additional Docker volumes to mount. |
volumes | string[] | Where to mount the specified volumes from. |
working | string | Working directory inside the Docker container. |
image
Type:
Docker
The Docker image where the command will run.
bundlingFileAccess?
Type:
Bundling
(optional, default: BundlingFileAccess.BIND_MOUNT)
The access mechanism used to make source files available to the bundling container and to return the bundling output back to the host.
command?
Type:
string[]
(optional, default: run the command defined in the image)
The command to run in the Docker container.
Example value: ['npm', 'install']
See also: https://docs.docker.com/engine/reference/run/
entrypoint?
Type:
string[]
(optional, default: run the entrypoint defined in the image)
The entrypoint to run in the Docker container.
Example value: ['/bin/sh', '-c']
See also: https://docs.docker.com/engine/reference/builder/#entrypoint
environment?
Type:
{ [string]: string }
(optional, default: no environment variables.)
The environment variables to pass to the Docker container.
local?
Type:
ILocal
(optional, default: bundling will only be performed in a Docker container)
Local bundling provider.
The provider implements a method tryBundle()
which should return true
if local bundling was performed. If false
is returned, docker bundling
will be done.
network?
Type:
string
(optional, default: no networking options)
Docker Networking options.
outputType?
Type:
Bundling
(optional, default: BundlingOutput.AUTO_DISCOVER)
The type of output that this bundling operation is producing.
platform?
Type:
string
(optional, default: no platform specified (the current machine architecture will be used))
Platform to build for. Requires Docker Buildx.
Specify this property to build images on a specific platform.
securityOpt?
Type:
string
(optional, default: no security options)
Security configuration when running the docker container.
user?
Type:
string
(optional, default: uid:gid of the current user or 1000:1000 on Windows)
The user to use when running the Docker container.
user | user:group | uid | uid:gid | user:gid | uid:group
See also: https://docs.docker.com/engine/reference/run/#user
volumes?
Type:
Docker
[]
(optional, default: no additional volumes are mounted)
Additional Docker volumes to mount.
volumesFrom?
Type:
string[]
(optional, default: no containers are specified to mount volumes from)
Where to mount the specified volumes from.
workingDirectory?
Type:
string
(optional, default: /asset-input)
Working directory inside the Docker container.