Class AssetImageCode.Builder

java.lang.Object
software.amazon.awscdk.services.lambda.AssetImageCode.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<AssetImageCode>
Enclosing class:
AssetImageCode

@Stability(Stable) public static final class AssetImageCode.Builder extends Object implements software.amazon.jsii.Builder<AssetImageCode>
A fluent builder for AssetImageCode.
  • Method Details

    • create

      @Stability(Stable) public static AssetImageCode.Builder create(String directory)
      Parameters:
      directory - This parameter is required.
      Returns:
      a new instance of AssetImageCode.Builder.
    • exclude

      @Stability(Stable) public AssetImageCode.Builder exclude(List<String> exclude)
      Glob patterns to exclude from the copy.

      Default: - nothing is excluded

      Parameters:
      exclude - Glob patterns to exclude from the copy. This parameter is required.
      Returns:
      this
    • follow

      @Stability(Deprecated) @Deprecated public AssetImageCode.Builder follow(FollowMode follow)
      Deprecated.
      use followSymlinks instead
      (deprecated) A strategy for how to handle symlinks.

      Default: Never

      Parameters:
      follow - A strategy for how to handle symlinks. This parameter is required.
      Returns:
      this
    • ignoreMode

      @Stability(Stable) public AssetImageCode.Builder ignoreMode(IgnoreMode ignoreMode)
      The ignore behavior to use for exclude patterns.

      Default: IgnoreMode.GLOB

      Parameters:
      ignoreMode - The ignore behavior to use for exclude patterns. This parameter is required.
      Returns:
      this
    • extraHash

      @Stability(Stable) public AssetImageCode.Builder extraHash(String extraHash)
      Extra information to encode into the fingerprint (e.g. build instructions and other inputs).

      Default: - hash is only based on source content

      Parameters:
      extraHash - Extra information to encode into the fingerprint (e.g. build instructions and other inputs). This parameter is required.
      Returns:
      this
    • followSymlinks

      @Stability(Stable) public AssetImageCode.Builder followSymlinks(SymlinkFollowMode followSymlinks)
      A strategy for how to handle symlinks.

      Default: SymlinkFollowMode.NEVER

      Parameters:
      followSymlinks - A strategy for how to handle symlinks. This parameter is required.
      Returns:
      this
    • buildArgs

      @Stability(Stable) public AssetImageCode.Builder buildArgs(Map<String,String> buildArgs)
      Build args to pass to the docker build command.

      Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such as lambda.functionArn or queue.queueUrl).

      Default: - no build args are passed

      Parameters:
      buildArgs - Build args to pass to the docker build command. This parameter is required.
      Returns:
      this
    • file

      @Stability(Stable) public AssetImageCode.Builder file(String file)
      Path to the Dockerfile (relative to the directory).

      Default: 'Dockerfile'

      Parameters:
      file - Path to the Dockerfile (relative to the directory). This parameter is required.
      Returns:
      this
    • invalidation

      @Stability(Stable) public AssetImageCode.Builder invalidation(DockerImageAssetInvalidationOptions invalidation)
      Options to control which parameters are used to invalidate the asset hash.

      Default: - hash all parameters

      Parameters:
      invalidation - Options to control which parameters are used to invalidate the asset hash. This parameter is required.
      Returns:
      this
    • networkMode

      @Stability(Stable) public AssetImageCode.Builder networkMode(NetworkMode networkMode)
      Networking mode for the RUN commands during build.

      Support docker API 1.25+.

      Default: - no networking mode specified (the default networking mode `NetworkMode.DEFAULT` will be used)

      Parameters:
      networkMode - Networking mode for the RUN commands during build. This parameter is required.
      Returns:
      this
    • platform

      @Stability(Stable) public AssetImageCode.Builder platform(Platform platform)
      Platform to build for.

      Requires Docker Buildx.

      Default: - no platform specified (the current machine architecture will be used)

      Parameters:
      platform - Platform to build for. This parameter is required.
      Returns:
      this
    • repositoryName

      @Stability(Deprecated) @Deprecated public AssetImageCode.Builder repositoryName(String repositoryName)
      Deprecated.
      to control the location of docker image assets, please override Stack.addDockerImageAsset. this feature will be removed in future releases.
      (deprecated) ECR repository name.

      Specify this property if you need to statically address the image, e.g. from a Kubernetes Pod. Note, this is only the repository name, without the registry and the tag parts.

      Default: - the default ECR repository for CDK assets

      Parameters:
      repositoryName - ECR repository name. This parameter is required.
      Returns:
      this
    • target

      @Stability(Stable) public AssetImageCode.Builder target(String target)
      Docker target to build to.

      Default: - no target

      Parameters:
      target - Docker target to build to. This parameter is required.
      Returns:
      this
    • cmd

      @Stability(Stable) public AssetImageCode.Builder cmd(List<String> cmd)
      Specify or override the CMD on the specified Docker image or Dockerfile.

      This needs to be in the 'exec form', viz., [ 'executable', 'param1', 'param2' ].

      Default: - use the CMD specified in the docker image or Dockerfile.

      Parameters:
      cmd - Specify or override the CMD on the specified Docker image or Dockerfile. This parameter is required.
      Returns:
      this
      See Also:
    • entrypoint

      @Stability(Stable) public AssetImageCode.Builder entrypoint(List<String> entrypoint)
      Specify or override the ENTRYPOINT on the specified Docker image or Dockerfile.

      An ENTRYPOINT allows you to configure a container that will run as an executable. This needs to be in the 'exec form', viz., [ 'executable', 'param1', 'param2' ].

      Default: - use the ENTRYPOINT in the docker image or Dockerfile.

      Parameters:
      entrypoint - Specify or override the ENTRYPOINT on the specified Docker image or Dockerfile. This parameter is required.
      Returns:
      this
      See Also:
    • workingDirectory

      @Stability(Stable) public AssetImageCode.Builder workingDirectory(String workingDirectory)
      Specify or override the WORKDIR on the specified Docker image or Dockerfile.

      A WORKDIR allows you to configure the working directory the container will use.

      Default: - use the WORKDIR in the docker image or Dockerfile.

      Parameters:
      workingDirectory - Specify or override the WORKDIR on the specified Docker image or Dockerfile. This parameter is required.
      Returns:
      this
      See Also:
    • build

      @Stability(Stable) public AssetImageCode build()
      Specified by:
      build in interface software.amazon.jsii.Builder<AssetImageCode>
      Returns:
      a newly built instance of AssetImageCode.