Skip to content

Conversation

@tarunb12
Copy link
Contributor

@tarunb12 tarunb12 commented Dec 12, 2025

Issue # (if applicable)

aws/aws-cdk-rfcs#789

Reason for this change

EC2 Image Builder recently supported invoking pipelines via CloudFormation with a new property on AWS::ImageBuilder::Image, ImagePipelineExecutionSettings:

TriggeredImage:
  Type: AWS::ImageBuilder::Image
  Properties:
    # Natively triggers the pipeline when it is created or receives any update
    ImagePipelineExecutionSettings:
      DeploymentId: !GetAtt 'ImagePipeline.DeploymentId'
      OnUpdate: true

This change supports this in Image Builder's L2 alpha module too.

Description of changes

On the Image construct, a new imagePipelineExecutionSettings property has been added - which is mutually exclusive with other properties (except tags on the image). A start method has also been added on ImagePipeline as a nicer way to create an image from a pipeline, instead of from a recipe directly:

const imagePipeline = new imagebuilder.ImagePipeline(stack, 'ImagePipeline-AMI', {
  ...
});

// Create image from pipeline directly with the Image construct
const image = new imagebuilder.Image(stack, 'Image-StartPipeline', {
  imagePipelineExecutionSettings: { imagePipeline, onUpdate: false },
  tags: { tagKey1: 'tagValue1', tagKey2: 'tagValue2' },
});

// Trigger from the pipeline construct, which triggers the pipeline when it receives an update
imagePipeline.start({ onUpdate: true, tags: { key1: 'value1', key2: 'value2' } });

// Minimal parameters
imagePipeline.start();

Describe any new or updated permissions being added

N/A

Description of how you validated changes

Unit and integration tests have been added for all changes

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team December 12, 2025 14:40
@github-actions github-actions bot added p2 valued-contributor [Pilot] contributed between 6-12 PRs to the CDK labels Dec 12, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 12, 2025

TestsPassed ☑️SkippedFailed ❌️
Security Guardian Results104 ran102 passed2 failed
TestResult
Security Guardian Results
packages/@aws-cdk/aws-imagebuilder-alpha/test/integ.all-parameters.image-pipeline.ami.js.snapshot/aws-cdk-imagebuilder-image-pipeline-ami-all-parameters.template.json
iam-no-overly-permissive-passrole.guard❌ failure
packages/@aws-cdk/aws-imagebuilder-alpha/test/integ.all-parameters.image-pipeline.container.js.snapshot/aws-cdk-imagebuilder-image-pipeline-container-all-parameters.template.json
iam-no-overly-permissive-passrole.guard❌ failure

@github-actions
Copy link
Contributor

github-actions bot commented Dec 12, 2025

TestsPassed ☑️SkippedFailed ❌️
Security Guardian Results with resolved templates104 ran102 passed2 failed
TestResult
Security Guardian Results with resolved templates
packages/@aws-cdk/aws-imagebuilder-alpha/test/integ.all-parameters.image-pipeline.ami.js.snapshot/aws-cdk-imagebuilder-image-pipeline-ami-all-parameters.template.json
iam-no-overly-permissive-passrole.guard❌ failure
packages/@aws-cdk/aws-imagebuilder-alpha/test/integ.all-parameters.image-pipeline.container.js.snapshot/aws-cdk-imagebuilder-image-pipeline-container-all-parameters.template.json
iam-no-overly-permissive-passrole.guard❌ failure

@aws-cdk-automation aws-cdk-automation added the pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. label Dec 12, 2025
@tarunb12 tarunb12 marked this pull request as ready for review December 12, 2025 15:17
@tarunb12 tarunb12 force-pushed the imagebuilder/start-image-pipeline-execution branch from 6ce2827 to 92faa01 Compare December 15, 2025 16:25
@aws-cdk-automation aws-cdk-automation removed the pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. label Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2 valued-contributor [Pilot] contributed between 6-12 PRs to the CDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants