Class GenericLinuxImage

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ec2.GenericLinuxImage
All Implemented Interfaces:
IMachineImage, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:16.004Z") @Stability(Stable) public class GenericLinuxImage extends software.amazon.jsii.JsiiObject implements IMachineImage
Construct a Linux machine image from an AMI map.

Linux images IDs are not published to SSM parameter store yet, so you'll have to manually specify an AMI map.

Example:

 // Pick a Windows edition to use
 WindowsImage windows = new WindowsImage(WindowsVersion.WINDOWS_SERVER_2019_ENGLISH_FULL_BASE);
 // Pick the right Amazon Linux edition. All arguments shown are optional
 // and will default to these values when omitted.
 AmazonLinuxImage amznLinux = AmazonLinuxImage.Builder.create()
         .generation(AmazonLinuxGeneration.AMAZON_LINUX)
         .edition(AmazonLinuxEdition.STANDARD)
         .virtualization(AmazonLinuxVirt.HVM)
         .storage(AmazonLinuxStorage.GENERAL_PURPOSE)
         .build();
 // For other custom (Linux) images, instantiate a `GenericLinuxImage` with
 // a map giving the AMI to in for each region:
 GenericLinuxImage linux = new GenericLinuxImage(Map.of(
         "us-east-1", "ami-97785bed",
         "eu-west-1", "ami-12345678"));
 
  • Constructor Details

    • GenericLinuxImage

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

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

      @Stability(Stable) public GenericLinuxImage(@NotNull Map<String,String> amiMap, @Nullable GenericLinuxImageProps props)
      Parameters:
      amiMap - This parameter is required.
      props -
    • GenericLinuxImage

      @Stability(Stable) public GenericLinuxImage(@NotNull Map<String,String> amiMap)
      Parameters:
      amiMap - This parameter is required.
  • Method Details

    • getImage

      @Stability(Stable) @NotNull public MachineImageConfig getImage(@NotNull software.constructs.Construct scope)
      Return the image to use in the given context.

      Specified by:
      getImage in interface IMachineImage
      Parameters:
      scope - This parameter is required.