ImageRecipe
The ImageRecipe resource allows you to define and manage AWS ImageBuilder ImageRecipes which specify how to create images using various components and configurations.
Minimal Example
Section titled “Minimal Example”Create a basic image recipe with required properties and a common optional property.
import AWS from "alchemy/aws/control";
const basicImageRecipe = await AWS.ImageBuilder.ImageRecipe("basicImageRecipe", { name: "MyBasicImageRecipe", parentImage: "arn:aws:imagebuilder:us-west-2:123456789012:image/my-base-image", version: "1.0.0", components: [ { componentArn: "arn:aws:imagebuilder:us-west-2:123456789012:component/my-component" } ], workingDirectory: "/var/imagebuilder"});
Advanced Configuration
Section titled “Advanced Configuration”Configure an image recipe with additional instance configuration and block device mappings.
const advancedImageRecipe = await AWS.ImageBuilder.ImageRecipe("advancedImageRecipe", { name: "MyAdvancedImageRecipe", parentImage: "arn:aws:imagebuilder:us-west-2:123456789012:image/my-base-image", version: "1.0.1", components: [ { componentArn: "arn:aws:imagebuilder:us-west-2:123456789012:component/my-component" } ], blockDeviceMappings: [ { deviceName: "/dev/xvda", ebs: { volumeSize: 30, deleteOnTermination: true, encrypted: false } } ], additionalInstanceConfiguration: { userDataOverride: "IyEvYmluL2Jhc2gKc3VsdCAiSGVsbG8sIFdvcmxkISI=" }});
Custom Tags
Section titled “Custom Tags”Create an image recipe with custom tags for better resource management and identification.
const taggedImageRecipe = await AWS.ImageBuilder.ImageRecipe("taggedImageRecipe", { name: "MyTaggedImageRecipe", parentImage: "arn:aws:imagebuilder:us-west-2:123456789012:image/my-base-image", version: "1.0.2", components: [ { componentArn: "arn:aws:imagebuilder:us-west-2:123456789012:component/my-component" } ], tags: { Project: "MyProject", Environment: "Development" }});
Combining Components
Section titled “Combining Components”Demonstrate how to combine multiple components into a single image recipe.
const combinedComponentsImageRecipe = await AWS.ImageBuilder.ImageRecipe("combinedComponentsImageRecipe", { name: "MyCombinedImageRecipe", parentImage: "arn:aws:imagebuilder:us-west-2:123456789012:image/my-base-image", version: "1.0.3", components: [ { componentArn: "arn:aws:imagebuilder:us-west-2:123456789012:component/my-component-1" }, { componentArn: "arn:aws:imagebuilder:us-west-2:123456789012:component/my-component-2" } ]});