@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:35.795Z") @Stability(value=Stable) public interface BundlingOptions extends software.amazon.jsii.JsiiSerializable
Example:
// Example automatically generated from non-compiling source. May contain errors.
Asset asset = Asset.Builder.create(this, "BundledAsset")
.path("/path/to/asset")
.bundling(BundlingOptions.builder()
.image(ambda.getRuntime().getPYTHON_3_9().getBundlingImage())
.command(List.of("bash", "-c", "pip install -r requirements.txt -t /asset-output && cp -au . /asset-output"))
.securityOpt("no-new-privileges:true") // https://docs.docker.com/engine/reference/commandline/run/#optional-security-options---security-opt
.network("host")
.build())
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
BundlingOptions.Builder
A builder for
BundlingOptions |
static class |
BundlingOptions.Jsii$Proxy
An implementation for
BundlingOptions |
| Modifier and Type | Method and Description |
|---|---|
static BundlingOptions.Builder |
builder() |
default List<String> |
getCommand()
The command to run in the Docker container.
|
default List<String> |
getEntrypoint()
The entrypoint to run in the Docker container.
|
default Map<String,String> |
getEnvironment()
The environment variables to pass to the Docker container.
|
DockerImage |
getImage()
The Docker image where the command will run.
|
default ILocalBundling |
getLocal()
Local bundling provider.
|
default String |
getNetwork()
Docker [Networking options](https://docs.docker.com/engine/reference/commandline/run/#connect-a-container-to-a-network---network).
|
default BundlingOutput |
getOutputType()
The type of output that this bundling operation is producing.
|
default String |
getSecurityOpt()
[Security configuration](https://docs.docker.com/engine/reference/run/#security-configuration) when running the docker container.
|
default String |
getUser()
The user to use when running the Docker container.
|
default List<DockerVolume> |
getVolumes()
Additional Docker volumes to mount.
|
default String |
getWorkingDirectory()
Working directory inside the Docker container.
|
@Stability(value=Stable) @NotNull DockerImage getImage()
@Stability(value=Stable) @Nullable default List<String> getCommand()
Example value: ['npm', 'install']
Default: - run the command defined in the image
@Stability(value=Stable) @Nullable default List<String> getEntrypoint()
Example value: ['/bin/sh', '-c']
Default: - run the entrypoint defined in the image
@Stability(value=Stable) @Nullable default Map<String,String> getEnvironment()
Default: - no environment variables.
@Stability(value=Stable) @Nullable default ILocalBundling getLocal()
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
@Stability(value=Stable) @Nullable default String getNetwork()
Default: - no networking options
@Stability(value=Stable) @Nullable default BundlingOutput getOutputType()
Default: BundlingOutput.AUTO_DISCOVER
@Stability(value=Stable) @Nullable default String getSecurityOpt()
Default: - no security options
@Stability(value=Stable) @Nullable default String getUser()
user | user:group | uid | uid:gid | user:gid | uid:group
Default: - uid:gid of the current user or 1000:1000 on Windows
@Stability(value=Stable) @Nullable default List<DockerVolume> getVolumes()
Default: - no additional volumes are mounted
@Stability(value=Stable) @Nullable default String getWorkingDirectory()
Default: /asset-input
@Stability(value=Stable) static BundlingOptions.Builder builder()
BundlingOptions.Builder of BundlingOptionsCopyright © 2022. All rights reserved.