Experimental
@aws-cdk/aws-imagebuilder-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
ImageRecipeProps Struct
Properties for creating an Image Recipe resource.
Example
ts
const parameterizedComponent = imagebuilder.Component.fromComponentName(
this,
'ParameterizedComponent',
'my-parameterized-component'
);
const imageRecipe = new imagebuilder.ImageRecipe(this, 'ParameterizedImageRecipe', {
baseImage: imagebuilder.BaseImage.fromSsmParameterName(
'/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-default-x86_64'
),
components: [
{
component: parameterizedComponent,
parameters: {
environment: imagebuilder.ComponentParameterValue.fromString('production'),
version: imagebuilder.ComponentParameterValue.fromString('1.0.0')
}
}
]
});
Properties
amiTagsoptional{ [key: string]: string }ami_tagsoptionaltyping.Mapping[str, str]amiTagsoptionalMap<String, String>AmiTagsoptionalIDictionary<string, string>AmiTagsoptional*map[string]*string= None#The additional tags to assign to the output AMI generated by the build.
baseImageBaseImagebase_imageBaseImagebaseImageBaseImageBaseImageBaseImageBaseImageBaseImagerequired#The base image for customizations specified in the image recipe.
blockDevicesoptionalBlockDevice[]block_devicesoptionaltyping.List[BlockDevice]blockDevicesoptionalList<BlockDevice>BlockDevicesoptionalBlockDevice[]BlockDevicesoptional*[]BlockDevice= None#The block devices to attach to the instance used for building the image.
componentsoptionalComponentConfiguration[]componentsoptionaltyping.List[ComponentConfiguration]componentsoptionalList<ComponentConfiguration>ComponentsoptionalComponentConfiguration[]Componentsoptional*[]ComponentConfiguration= None#The list of component configurations to apply in the image build.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string= None#The description of the image recipe.
imageRecipeNameoptionalstringimage_recipe_nameoptionalstrimageRecipeNameoptionalStringImageRecipeNameoptionalstringImageRecipeNameoptional*string#The name of the image recipe.
Default: a name is generated
imageRecipeVersionoptionalstringimage_recipe_versionoptionalstrimageRecipeVersionoptionalStringImageRecipeVersionoptionalstringImageRecipeVersionoptional*string= 1.0.x#The version of the image recipe.
tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string= None#The tags to apply to the image recipe.
uninstallSsmAgentAfterBuildoptionalbooleanuninstall_ssm_agent_after_buildoptionalbooluninstallSsmAgentAfterBuildoptionalBooleanUninstallSsmAgentAfterBuildoptionalboolUninstallSsmAgentAfterBuildoptional*bool#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.
userDataOverrideoptionalUserDatauser_data_overrideoptionalUserDatauserDataOverrideoptionalUserDataUserDataOverrideoptionalUserDataUserDataOverrideoptionalUserData= None#The user data commands to pass to Image Builder build and test EC2 instances.
notes
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.
workingDirectoryoptionalstringworking_directoryoptionalstrworkingDirectoryoptionalStringWorkingDirectoryoptionalstringWorkingDirectoryoptional*string#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:/