BaseContainerImage

class aws_cdk.aws_imagebuilder_alpha.BaseContainerImage(image)

Bases: object

(experimental) Represents a base image that is used to start from in EC2 Image Builder image builds.

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")
        }
    )
    ]
)
Parameters:

image (str)

Stability:

experimental

Attributes

image

(experimental) The rendered base image to use.

Stability:

experimental

Static Methods

classmethod from_docker_hub(repository, tag)

(experimental) The DockerHub image to use as the base image in a container recipe.

Parameters:
  • repository (str) – The DockerHub repository where the base image resides in.

  • tag (str) – The tag of the base image in the DockerHub repository.

Stability:

experimental

Return type:

BaseContainerImage

classmethod from_ecr(repository, tag)

(experimental) The ECR container image to use as the base image in a container recipe.

Parameters:
  • repository (IRepository) – The ECR repository where the base image resides in.

  • tag (str) – The tag of the base image in the ECR repository.

Stability:

experimental

Return type:

BaseContainerImage

classmethod from_ecr_public(registry_alias, repository_name, tag)

(experimental) The ECR public container image to use as the base image in a container recipe.

Parameters:
  • registry_alias (str) – The alias of the ECR public registry where the base image resides in.

  • repository_name (str) – The name of the ECR public repository, where the base image resides in.

  • tag (str) – The tag of the base image in the ECR public repository.

Stability:

experimental

Return type:

BaseContainerImage

classmethod from_image(image)

(experimental) The EC2 Image Builder image to use as a base image in a container recipe.

Parameters:

image (IImage) – The EC2 Image Builder image to use as a base image.

Stability:

experimental

Return type:

BaseContainerImage

classmethod from_string(base_container_image_string)

(experimental) The string value of the base image to use in a container recipe.

This can be an EC2 Image Builder image ARN, an ECR or ECR public image, or a container URI sourced from a third-party container registry such as DockerHub.

Parameters:

base_container_image_string (str) – The base image as a direct string value.

Stability:

experimental

Return type:

BaseContainerImage