java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.imagebuilder.alpha.ImageRecipe
All Implemented Interfaces:
IEnvironmentAware, IResource, IImageRecipe, IRecipeBase, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)", date="2025-12-05T22:26:50.063Z") @Stability(Experimental) public class ImageRecipe extends Resource implements IImageRecipe
(experimental) Represents an EC2 Image Builder Image Recipe.

Example:

 IComponent parameterizedComponent = Component.fromComponentName(this, "ParameterizedComponent", "my-parameterized-component");
 ImageRecipe imageRecipe = ImageRecipe.Builder.create(this, "ParameterizedImageRecipe")
         .baseImage(BaseImage.fromSsmParameterName("/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-default-x86_64"))
         .components(List.of(ComponentConfiguration.builder()
                 .component(parameterizedComponent)
                 .parameters(Map.of(
                         "environment", ComponentParameterValue.fromString("production"),
                         "version", ComponentParameterValue.fromString("1.0.0")))
                 .build()))
         .build();
 

See Also:
  • Field Details

    • PROPERTY_INJECTION_ID

      @Stability(Experimental) public static final String PROPERTY_INJECTION_ID
      (experimental) Uniquely identifies this class.
  • Constructor Details

    • ImageRecipe

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

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

      @Stability(Experimental) public ImageRecipe(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ImageRecipeProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromImageRecipeArn

      @Stability(Experimental) @NotNull public static IImageRecipe fromImageRecipeArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String imageRecipeArn)
      (experimental) Import an existing image recipe given its ARN.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      imageRecipeArn - This parameter is required.
    • fromImageRecipeAttributes

      @Stability(Experimental) @NotNull public static IImageRecipe fromImageRecipeAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ImageRecipeAttributes attrs)
      (experimental) Import an existing image recipe by providing its attributes.

      If the image recipe name is provided as an attribute, it must be normalized by converting all alphabetical characters to lowercase, and replacing all spaces and underscores with hyphens.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      attrs - This parameter is required.
    • fromImageRecipeName

      @Stability(Experimental) @NotNull public static IImageRecipe fromImageRecipeName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String imageRecipeName)
      (experimental) Import the latest version of an existing image recipe given its name.

      The provided name must be normalized by converting all alphabetical characters to lowercase, and replacing all spaces and underscores with hyphens.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      imageRecipeName - This parameter is required.
    • isImageRecipe

      @Stability(Experimental) @NotNull public static Boolean isImageRecipe(@NotNull Object x)
      (experimental) Return whether the given object is an ImageRecipe.

      Parameters:
      x - This parameter is required.
    • addBlockDevice

      @Stability(Experimental) public void addBlockDevice(@NotNull BlockDevice... blockDevices)
      (experimental) Adds block devices to attach to the instance used for building the image.

      Parameters:
      blockDevices - The list of block devices to attach. This parameter is required.
    • grant

      @Stability(Experimental) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull String... actions)
      (experimental) Grant custom actions to the given grantee for the image recipe.

      Specified by:
      grant in interface IRecipeBase
      Parameters:
      grantee - The principal. This parameter is required.
      actions - The list of actions. This parameter is required.
    • grantRead

      @Stability(Experimental) @NotNull public Grant grantRead(@NotNull IGrantable grantee)
      (experimental) Grant read permissions to the given grantee for the image recipe.

      Specified by:
      grantRead in interface IRecipeBase
      Parameters:
      grantee - The principal. This parameter is required.
    • getImageRecipeArn

      @Stability(Experimental) @NotNull public String getImageRecipeArn()
      (experimental) The ARN of the image recipe.
      Specified by:
      getImageRecipeArn in interface IImageRecipe
    • getImageRecipeName

      @Stability(Experimental) @NotNull public String getImageRecipeName()
      (experimental) The name of the image recipe.
      Specified by:
      getImageRecipeName in interface IImageRecipe
    • getImageRecipeVersion

      @Stability(Experimental) @NotNull public String getImageRecipeVersion()
      (experimental) The version of the image recipe.
      Specified by:
      getImageRecipeVersion in interface IImageRecipe