Skip to content
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

feat(cli-lib-alpha): support hotswap deployments #26786

Merged
merged 2 commits into from
Sep 18, 2023
Merged

feat(cli-lib-alpha): support hotswap deployments #26786

merged 2 commits into from
Sep 18, 2023

Conversation

amine-mf
Copy link
Contributor

@amine-mf amine-mf commented Aug 17, 2023

Closes #26785.

Exemption Request: The cli-lib-alpha README does not currently specify the exhaustive list of arguments, which looks like a choice, thus I did not add the new argument. Currently, no integration tests were implemented for this lib, only unit tests which I did update/add.


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

@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Aug 17, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team August 17, 2023 08:30
@github-actions github-actions bot added feature-request A feature should be added or improved. p2 labels Aug 17, 2023
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a 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.

@aws-cdk-automation aws-cdk-automation added pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Aug 17, 2023
@github-actions github-actions bot added the effort/small Small work item – less than a day of effort label Aug 18, 2023
@aws-cdk-automation aws-cdk-automation removed pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Aug 18, 2023
@ajhool
Copy link

ajhool commented Sep 1, 2023

I recently submitted an issue related to the bootstrap roles and Hotswap in the CDK CLI (linked above, #26978). I'm not sure whether CDK CLI and CDK Lib use the same approach to assuming CDK Boostrap IAM roles, but if they do then I think that issue also affects CDK Lib.

TLDR: The CDK bootstrap roles don't have necessary permissions for Hotswap to work, so for hotswap you would need to create a custom IAM role that has all required permissions (like UpdateLambda-type permissions). The #26978 is a request for the hotswap team to create a CDK role that includes the necessary permissions so that users don't need to manage custom IAM users / roles.

PS. First time seeing that CDK Lib is in alpha and I'm really excited!

@amine-mf
Copy link
Contributor Author

amine-mf commented Sep 5, 2023

I recently submitted an issue related to the bootstrap roles and Hotswap in the CDK CLI (linked above, #26978). I'm not sure whether CDK CLI and CDK Lib use the same approach to assuming CDK Boostrap IAM roles, but if they do then I think that issue also affects CDK Lib.

TLDR: The CDK bootstrap roles don't have necessary permissions for Hotswap to work, so for hotswap you would need to create a custom IAM role that has all required permissions (like UpdateLambda-type permissions). The #26978 is a request for the hotswap team to create a CDK role that includes the necessary permissions so that users don't need to manage custom IAM users / roles.

PS. First time seeing that CDK Lib is in alpha and I'm really excited!

We never faced the issue before, we run the hotswap as admins as we do it only on our dev sandboxes (talking about lambdas). Using the cli-lib-alpha, we hotswap state machines, and we did not face any issue related to access rights (this runs inside a lambda with a specific role).
I think this lib and the cli do share code and the problem is probably more global but for me it is out of this PR's scope. Especially that it is very urgent for our team to have it merged.

@aws-cdk-automation
Copy link
Collaborator

This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

@amine-mf
Copy link
Contributor Author

amine-mf commented Sep 8, 2023

Can anybody add pr-linter/exempt-integ-test and pr-linter/exempt-readme labels as per the Exemption Request on the first comment? (This will give a more accurate state of the PR and remove the change request status).
Thanks

@aws-cdk-automation aws-cdk-automation added pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Sep 8, 2023
@mrgrain mrgrain added pr-linter/exempt-test The PR linter will not require test changes pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-readme The PR linter will not require README changes and removed pr-linter/exempt-test The PR linter will not require test changes labels Sep 8, 2023
@mrgrain
Copy link
Contributor

mrgrain commented Sep 8, 2023

@amine-mf Apologies. I have been busy this week. Should be able to get to it next week.

@aws-cdk-automation aws-cdk-automation dismissed their stale review September 8, 2023 09:00

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: ccf7887
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mrgrain mrgrain changed the title feat(cli-lib-alpha): add hotswap support for the deploy command feat(cli-lib-alpha): support hotswap deployments Sep 18, 2023
@github-actions github-actions bot added p1 and removed p2 labels Sep 18, 2023
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Sep 18, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 18, 2023

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).

@mergify mergify bot merged commit e01faff into aws:main Sep 18, 2023
16 checks passed
HBobertz pushed a commit that referenced this pull request Sep 18, 2023
Closes #26785.

Exemption Request: The `cli-lib-alpha` README does not currently specify the exhaustive list of arguments, which looks like a choice, thus I did not add the new argument. Currently, no integration tests were implemented for this lib, only unit tests which I did update/add.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
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/small Small work item – less than a day of effort feature-request A feature should be added or improved. p1 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-readme The PR linter will not require README changes pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(cli-lib-alpha): Missing hotswap option in the deploy command
4 participants