ImageRecipeProps

class aws_cdk.aws_imagebuilder_alpha.ImageRecipeProps(*, base_image, ami_tags=None, block_devices=None, components=None, description=None, image_recipe_name=None, image_recipe_version=None, tags=None, uninstall_ssm_agent_after_build=None, user_data_override=None, working_directory=None)

Bases: object

(experimental) Properties for creating an Image Recipe resource.

Parameters:
  • base_image (BaseImage) – (experimental) The base image for customizations specified in the image recipe.

  • ami_tags (Optional[Mapping[str, str]]) – (experimental) The additional tags to assign to the output AMI generated by the build. Default: None

  • block_devices (Optional[Sequence[Union[BlockDevice, Dict[str, Any]]]]) – (experimental) The block devices to attach to the instance used for building the image. Default: None

  • components (Optional[Sequence[Union[ComponentConfiguration, Dict[str, Any]]]]) – (experimental) The list of component configurations to apply in the image build. Default: None

  • description (Optional[str]) – (experimental) The description of the image recipe. Default: None

  • image_recipe_name (Optional[str]) – (experimental) The name of the image recipe. Default: - a name is generated

  • image_recipe_version (Optional[str]) – (experimental) The version of the image recipe. Default: 1.0.x

  • tags (Optional[Mapping[str, str]]) – (experimental) The tags to apply to the image recipe. Default: None

  • uninstall_ssm_agent_after_build (Optional[bool]) – (experimental) Whether to uninstall the Systems Manager agent from your final build image, prior to creating the new AMI. Default: - this is false if the Systems Manager agent is pre-installed on the base image. Otherwise, this is true.

  • user_data_override (Optional[UserData]) – (experimental) The user data commands to pass to Image Builder build and test EC2 instances. For Linux and macOS, Image Builder uses a default user data script to install the Systems Manager agent. If you override the user data, you must ensure to add commands to install Systems Manager agent, if it is not pre-installed on your base image. Default: None

  • working_directory (Optional[str]) – (experimental) The working directory for use during build and test workflows. Default: - the Image Builder default working directory is used. For Linux and macOS builds, this would be /tmp. For Windows builds, this would be C:/

Stability:

experimental

ExampleMetadata:

infused

Example:

parameterized_component = imagebuilder.Component.from_component_name(self, "ParameterizedComponent", "my-parameterized-component")

image_recipe = imagebuilder.ImageRecipe(self, "ParameterizedImageRecipe",
    base_image=imagebuilder.BaseImage.from_ssm_parameter_name("/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-default-x86_64"),
    components=[imagebuilder.ComponentConfiguration(
        component=parameterized_component,
        parameters={
            "environment": imagebuilder.ComponentParameterValue.from_string("production"),
            "version": imagebuilder.ComponentParameterValue.from_string("1.0.0")
        }
    )
    ]
)

Attributes

ami_tags

(experimental) The additional tags to assign to the output AMI generated by the build.

Default:

None

Stability:

experimental

base_image

(experimental) The base image for customizations specified in the image recipe.

Stability:

experimental

block_devices

(experimental) The block devices to attach to the instance used for building the image.

Default:

None

Stability:

experimental

components

(experimental) The list of component configurations to apply in the image build.

Default:

None

Stability:

experimental

description

(experimental) The description of the image recipe.

Default:

None

Stability:

experimental

image_recipe_name

(experimental) The name of the image recipe.

Default:
  • a name is generated

Stability:

experimental

image_recipe_version

(experimental) The version of the image recipe.

Default:

1.0.x

Stability:

experimental

tags

(experimental) The tags to apply to the image recipe.

Default:

None

Stability:

experimental

uninstall_ssm_agent_after_build

(experimental) Whether to uninstall the Systems Manager agent from your final build image, prior to creating the new AMI.

Default:
  • this is false if the Systems Manager agent is pre-installed on the base image. Otherwise, this is true.

Stability:

experimental

user_data_override

(experimental) The user data commands to pass to Image Builder build and test EC2 instances.

For Linux and macOS, Image Builder uses a default user data script to install the Systems Manager agent. If you override the user data, you must ensure to add commands to install Systems Manager agent, if it is not pre-installed on your base image.

Default:

None

Stability:

experimental

working_directory

(experimental) The working directory for use during build and test workflows.

Default:

  • the Image Builder default working directory is used. For Linux and macOS builds, this would be /tmp. For

Windows builds, this would be C:/

Stability:

experimental