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.89.0 (build 2f74b3e)", date="2023-11-02T10:21:17.202Z") @Stability(Stable) public class AssetImage extends ContainerImage
An image that will be built from a local directory with a Dockerfile.

Example:

 import software.constructs.Construct;
 import software.amazon.awscdk.App;
 import software.amazon.awscdk.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.*;
 public class MyStack extends Stack {
     public MyStack(Construct scope, String id) {
         super(scope, id);
         this.node.setContext(ECS_REMOVE_DEFAULT_DESIRED_COUNT, true);
         Vpc vpc = Vpc.Builder.create(this, "VPC")
                 .maxAzs(2)
                 .build();
         QueueProcessingFargateService.Builder.create(this, "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 software.constructs.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.