Skip to content
GitHubXDiscord

ImagePipeline

The ImagePipeline resource lets you manage AWS ImageBuilder ImagePipelines for automating the creation, updating, and management of images. This resource allows you to define how images are built and managed in your AWS environment.

Create a basic image pipeline with required properties and a couple of common optional settings.

import AWS from "alchemy/aws/control";
const imagePipeline = await AWS.ImageBuilder.ImagePipeline("myImagePipeline", {
name: "MyImagePipeline",
infrastructureConfigurationArn: "arn:aws:imagebuilder:us-west-2:123456789012:infrastructure-configuration/myInfrastructureConfig",
imageScanningConfiguration: {
imageScanningEnabled: true,
ecrConfiguration: {
rescanDuration: 30 // Set to rescan every 30 days
}
},
description: "An example image pipeline for creating AMIs"
});

Configure an image pipeline with advanced settings such as workflows and tags.

const advancedImagePipeline = await AWS.ImageBuilder.ImagePipeline("advancedImagePipeline", {
name: "AdvancedImagePipeline",
infrastructureConfigurationArn: "arn:aws:imagebuilder:us-west-2:123456789012:infrastructure-configuration/myAdvancedInfrastructureConfig",
imageRecipeArn: "arn:aws:imagebuilder:us-west-2:123456789012:image-recipe/myImageRecipe",
distributionConfigurationArn: "arn:aws:imagebuilder:us-west-2:123456789012:distribution-configuration/myDistributionConfig",
schedule: {
scheduleExpression: "cron(0 0 * * ? *)", // Daily at midnight UTC
pipelineExecutionStartCondition: "ENABLE" // Enable automatic execution
},
workflows: [
{
workflowArn: "arn:aws:imagebuilder:us-west-2:123456789012:workflow/myWorkflow",
workflowType: "BUILD" // Specify the type of workflow
}
],
tags: {
Project: "ImageBuilderDemo",
Environment: "Development"
}
});

Set up an image pipeline with custom image tests configuration to validate the image after build.

const imageTestPipeline = await AWS.ImageBuilder.ImagePipeline("testImagePipeline", {
name: "TestImagePipeline",
infrastructureConfigurationArn: "arn:aws:imagebuilder:us-west-2:123456789012:infrastructure-configuration/myTestInfrastructureConfig",
imageRecipeArn: "arn:aws:imagebuilder:us-west-2:123456789012:image-recipe/myTestImageRecipe",
imageTestsConfiguration: {
imageTestsEnabled: true,
timeoutMinutes: 30 // Timeout for image tests
},
tags: {
Purpose: "Image Testing",
Status: "Active"
}
});

Enable enhanced image metadata for better tracking and management of images.

const enhancedMetadataPipeline = await AWS.ImageBuilder.ImagePipeline("enhancedMetadataPipeline", {
name: "EnhancedMetadataPipeline",
infrastructureConfigurationArn: "arn:aws:imagebuilder:us-west-2:123456789012:infrastructure-configuration/myMetadataInfrastructureConfig",
imageRecipeArn: "arn:aws:imagebuilder:us-west-2:123456789012:image-recipe/myMetadataImageRecipe",
enhancedImageMetadataEnabled: true, // Enable enhanced image metadata
tags: {
Feature: "EnhancedLogging",
Owner: "DevTeam"
}
});