-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix(core): file asset publishing role not used in cdk diff
to upload large templates
#31597
fix(core): file asset publishing role not used in cdk diff
to upload large templates
#31597
Conversation
…e bug Signed-off-by: Sumu <sumughan@amazon.com>
…sets in uploadBodyParameterAndCreateChangeSet in cloudformation.ts to fix bug Signed-off-by: Sumu <sumughan@amazon.com>
…plate is published succesffuly Signed-off-by: Sumu <sumughan@amazon.com>
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts
Show resolved
Hide resolved
cdk diff
to upload large diff templatescdk diff
to upload large templates
This is not a correct statement. It definitely was uploading things to S3. |
packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts
Show resolved
Hide resolved
Co-authored-by: Rico Hermans <rix0rrr@gmail.com>
Signed-off-by: Sumu <sumughan@amazon.com>
…ttps://github.com/aws/aws-cdk into sumughan/diff-file-asset-publishing-role-not-used
➡️ PR build request submitted to A maintainer must now check the pipeline and add the |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
Closes #29936
Reason for this change
When running
cdk diff
on larger templates, the CDK needs to upload the diff template to S3 to create the ChangeSet. However, the CLI is currently not using the the file asset publishing role to do so and is instead using the IAM user/role that is configured by the user in the CLI - this means that if the user/role lacks S3 permissions then theAccessDenied
error is thrown and users cannot see a full diff.Description of changes
This PR ensures that the
FileAssetPublishingRole
is used bycdk diff
to upload assets to S3 before creating a ChangeSet by:makeBodyParameterAndUpload
function which was using the deprecatedpublishAssets
function from deployments.tsuploadBodyParameterAndCreateChangeSet
function withincloudformation.ts
insteadDescription of how you validated changes
Integ test that deploys a simple CDK app with a single IAM role, then runs
cdk diff
on a large template change adding 200 IAM roles. I asserted that the logs did not contain the S3 access denied permissions errors, and also contained a statement for assuming the file publishing role. Reused the CDK app for the integ test from this PR by @sakurai-ryo which tried fixing this issue by adding another Bootstrap role (which we decided against).Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license