Class AssetImage

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ecs.ContainerImage
software.amazon.awscdk.services.ecs.AssetImage
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:47.003Z") @Stability(Stable) public class AssetImage extends ContainerImage
An image that will be built from a local directory with a Dockerfile.

Example:

 import software.amazon.awscdk.core.App;
 import software.amazon.awscdk.core.Stack;
 import software.amazon.awscdk.services.ec2.*;
 import software.amazon.awscdk.services.ecs.*;
 import software.amazon.awscdk.services.ecs.patterns.*;
 import software.amazon.awscdk.cxapi.*;
 import path.*;
 App app = new App();
 Stack stack = new Stack(app, "aws-ecs-patterns-queue");
 stack.node.setContext(ECS_REMOVE_DEFAULT_DESIRED_COUNT, true);
 Vpc vpc = Vpc.Builder.create(stack, "VPC")
         .maxAzs(2)
         .build();
 QueueProcessingFargateService.Builder.create(stack, "QueueProcessingService")
         .vpc(vpc)
         .memoryLimitMiB(512)
         .image(new AssetImage(join(__dirname, "..", "sqs-reader")))
         .build();
 
  • Constructor Details

    • AssetImage

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

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

      @Stability(Stable) public AssetImage(@NotNull String directory, @Nullable AssetImageProps props)
      Constructs a new instance of the AssetImage class.

      Parameters:
      directory - The directory containing the Dockerfile. This parameter is required.
      props -
    • AssetImage

      @Stability(Stable) public AssetImage(@NotNull String directory)
      Constructs a new instance of the AssetImage class.

      Parameters:
      directory - The directory containing the Dockerfile. This parameter is required.
  • Method Details

    • bind

      @Stability(Stable) @NotNull public ContainerImageConfig bind(@NotNull Construct scope, @NotNull ContainerDefinition containerDefinition)
      Called when the image is used by a ContainerDefinition.

      Specified by:
      bind in class ContainerImage
      Parameters:
      scope - This parameter is required.
      containerDefinition - This parameter is required.