-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat: conditional asset building in pipelines construct
#36004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rupe120
wants to merge
30
commits into
aws:main
Choose a base branch
from
rupe120:rupe120/conditional-asset-building
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5,213
−12
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws-cdk-automation
previously requested changes
Nov 11, 2025
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This review is outdated)
…20/aws-cdk into rupe120/conditional-asset-building
Author
|
Clarification Request |
…20/aws-cdk into rupe120/conditional-asset-building
pipelines): Conditional asset building in Pipelines construct
pipelines): Conditional asset building in Pipelines constructpipelines): Conditional asset building in Pipelines construct
pipelines): Conditional asset building in Pipelines constructpipelines): conditional asset building in Pipelines construct
pipelines): conditional asset building in Pipelines constructpipelines): conditional asset building in pipelines construct
pipelines): conditional asset building in pipelines constructpipelines construct
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
…20/aws-cdk into rupe120/conditional-asset-building
…20/aws-cdk into rupe120/conditional-asset-building
This was referenced Nov 15, 2025
…20/aws-cdk into rupe120/conditional-asset-building
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
beginning-contributor
[Pilot] contributed between 0-2 PRs to the CDK
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
pr/needs-further-review
PR requires additional review from our team specialists due to the scope or complexity of changes.
pr/reviewer-clarification-requested
The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue # (if applicable)
Closes #35913.
Reason for this change
Reduce unnecessary asset rebuilds in CDK Pipelines so iterative deployments finish faster and consume fewer build minutes.
Description of changes
Added the conditionallyBuildAssets flag to pipelines.CodePipeline and taught the asset publish actions to skip work when an identical asset already exists in S3 or ECR.
Generated per-asset bash commands that parse the manifest, probe S3 (HeadObject) or ECR (DescribeImages) and only invoke cdk-assets publish when needed.
Automatically extend the asset publishing CodeBuild role with the minimal IAM permissions required for the new existence checks.
Documented the feature in pipelines/README.md, including guidance and limitations.
Covered the behavior with compliance tests (command generation + IAM policies) and an integration test + snapshot for mixed file/Docker assets.
Describe any new or updated permissions being added
The asset publishing role now receives, when conditionallyBuildAssets is enabled:
These remain scoped to the specific asset buckets/repositories by the asset publishing process.
Description of how you validated changes
Added Jest compliance tests in pipelines/test/compliance/assets.test.ts.
Added an integration test (integ.newpipeline-with-conditional-asset-builds).
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license