ImageAttributes

class aws_cdk.aws_imagebuilder_alpha.ImageAttributes(*, image_arn=None, image_name=None, image_version=None)

Bases: object

(experimental) Properties for an EC2 Image Builder image.

Parameters:
  • image_arn (Optional[str]) – (experimental) The ARN of the image. Default: - derived from the imageName

  • image_name (Optional[str]) – (experimental) The name of the image. Default: - derived from the imageArn

  • image_version (Optional[str]) – (experimental) The version of the image. Default: - the latest version of the image, x.x.x

Stability:

experimental

ExampleMetadata:

infused

Example:

# Import by name
existing_image_by_name = imagebuilder.Image.from_image_name(self, "ExistingImageByName", "my-existing-image")

# Import by ARN
existing_image_by_arn = imagebuilder.Image.from_image_arn(self, "ExistingImageByArn", "arn:aws:imagebuilder:us-east-1:123456789012:image/imported-image/1.0.0")

# Import by attributes
existing_image_by_attributes = imagebuilder.Image.from_image_attributes(self, "ExistingImageByAttributes",
    image_name="shared-base-image",
    image_version="2024.11.25"
)

# Grant permissions to imported images
role = iam.Role(self, "ImageAccessRole",
    assumed_by=iam.ServicePrincipal("lambda.amazonaws.com")
)

existing_image_by_name.grant_read(role)
existing_image_by_arn.grant(role, "imagebuilder:GetImage", "imagebuilder:ListImagePackages")

Attributes

image_arn

(experimental) The ARN of the image.

Default:
  • derived from the imageName

Stability:

experimental

image_name

(experimental) The name of the image.

Default:
  • derived from the imageArn

Stability:

experimental

image_version

(experimental) The version of the image.

Default:
  • the latest version of the image, x.x.x

Stability:

experimental