Experimental
@aws-cdk/aws-imagebuilder-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
ImageAttributes Struct
Properties for an EC2 Image Builder image.
Example
ts
// Import by name
const existingImageByName = imagebuilder.Image.fromImageName(
this,
'ExistingImageByName',
'my-existing-image'
);
// Import by ARN
const existingImageByArn = imagebuilder.Image.fromImageArn(
this,
'ExistingImageByArn',
'arn:aws:imagebuilder:us-east-1:123456789012:image/imported-image/1.0.0'
);
// Import by attributes
const existingImageByAttributes = imagebuilder.Image.fromImageAttributes(this, 'ExistingImageByAttributes', {
imageName: 'shared-base-image',
imageVersion: '2024.11.25'
});
// Grant permissions to imported images
const role = new iam.Role(this, 'ImageAccessRole', {
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com')
});
existingImageByName.grantRead(role);
existingImageByArn.grant(role, 'imagebuilder:GetImage', 'imagebuilder:ListImagePackages');
Properties
imageArnoptionalstringimage_arnoptionalstrimageArnoptionalStringImageArnoptionalstringImageArnoptional*string#The ARN of the image.
Default: derived from the imageName
imageNameoptionalstringimage_nameoptionalstrimageNameoptionalStringImageNameoptionalstringImageNameoptional*string#The name of the image.
Default: derived from the imageArn
imageVersionoptionalstringimage_versionoptionalstrimageVersionoptionalStringImageVersionoptionalstringImageVersionoptional*string#The version of the image.
Default: the latest version of the image, x.x.x