Skip to content

Component

Source: src/AWS/ImageBuilder/Component.ts

An EC2 Image Builder component — a YAML document that defines the build, validation, and test steps applied to an instance during image creation.

Components are immutable versions: every property except tags replaces the component. Bump semanticVersion when changing the document.

const component = yield* ImageBuilder.Component("Setup", {
platform: "Linux",
semanticVersion: "1.0.0",
data: [
"name: setup",
"description: install packages",
"schemaVersion: 1.2",
"phases:",
" - name: build",
" steps:",
" - name: install",
" action: ExecuteBash",
" inputs:",
" commands:",
" - dnf install -y htop",
].join("\n"),
});
const recipe = yield* ImageBuilder.ImageRecipe("Recipe", {
parentImage: "arn:aws:imagebuilder:us-west-2:aws:image/amazon-linux-2023-x86/x.x.x",
components: [{ componentArn: component.componentBuildVersionArn }],
});