Class AssetImageCode

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.lambda.Code
software.amazon.awscdk.services.lambda.AssetImageCode
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.96.0 (build 921e240)", date="2024-04-10T22:22:29.919Z") @Stability(Stable) public class AssetImageCode extends Code
Represents an ECR image that will be constructed from the specified asset and can be bound as Lambda code.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.*;
 import software.amazon.awscdk.services.ecr.assets.*;
 import software.amazon.awscdk.services.lambda.*;
 NetworkMode networkMode;
 Platform platform;
 AssetImageCode assetImageCode = AssetImageCode.Builder.create("directory")
         .assetName("assetName")
         .buildArgs(Map.of(
                 "buildArgsKey", "buildArgs"))
         .buildSecrets(Map.of(
                 "buildSecretsKey", "buildSecrets"))
         .buildSsh("buildSsh")
         .cacheDisabled(false)
         .cacheFrom(List.of(DockerCacheOption.builder()
                 .type("type")
                 // the properties below are optional
                 .params(Map.of(
                         "paramsKey", "params"))
                 .build()))
         .cacheTo(DockerCacheOption.builder()
                 .type("type")
                 // the properties below are optional
                 .params(Map.of(
                         "paramsKey", "params"))
                 .build())
         .cmd(List.of("cmd"))
         .entrypoint(List.of("entrypoint"))
         .exclude(List.of("exclude"))
         .extraHash("extraHash")
         .file("file")
         .followSymlinks(SymlinkFollowMode.NEVER)
         .ignoreMode(IgnoreMode.GLOB)
         .invalidation(DockerImageAssetInvalidationOptions.builder()
                 .buildArgs(false)
                 .buildSecrets(false)
                 .buildSsh(false)
                 .extraHash(false)
                 .file(false)
                 .networkMode(false)
                 .outputs(false)
                 .platform(false)
                 .repositoryName(false)
                 .target(false)
                 .build())
         .networkMode(networkMode)
         .outputs(List.of("outputs"))
         .platform(platform)
         .target("target")
         .workingDirectory("workingDirectory")
         .build();
 
  • Constructor Details

    • AssetImageCode

      protected AssetImageCode(software.amazon.jsii.JsiiObjectRef objRef)
    • AssetImageCode

      protected AssetImageCode(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • AssetImageCode

      @Stability(Stable) public AssetImageCode(@NotNull String directory, @NotNull AssetImageCodeProps props)
      Parameters:
      directory - This parameter is required.
      props - This parameter is required.
  • Method Details

    • bind

      @Stability(Stable) @NotNull public CodeConfig bind(@NotNull software.constructs.Construct scope)
      Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun.

      Specified by:
      bind in class Code
      Parameters:
      scope - This parameter is required.
    • bindToResource

      @Stability(Stable) public void bindToResource(@NotNull CfnResource resource, @Nullable ResourceBindOptions options)
      Called after the CFN function resource has been created to allow the code class to bind to it.

      Specifically it's required to allow assets to add metadata for tooling like SAM CLI to be able to find their origins.

      Overrides:
      bindToResource in class Code
      Parameters:
      resource - This parameter is required.
      options -
    • bindToResource

      @Stability(Stable) public void bindToResource(@NotNull CfnResource resource)
      Called after the CFN function resource has been created to allow the code class to bind to it.

      Specifically it's required to allow assets to add metadata for tooling like SAM CLI to be able to find their origins.

      Overrides:
      bindToResource in class Code
      Parameters:
      resource - This parameter is required.
    • getIsInline

      @Stability(Stable) @NotNull public Boolean getIsInline()
      Determines whether this Code is inline code or not.