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

aws-codedeploy: Unable to update custom deployment config due to InstallLatestAwsSdk change throwing config already exists #25838

Closed
nina-ctrlv opened this issue Jun 2, 2023 · 3 comments
Labels
@aws-cdk/aws-codedeploy Related to AWS CodeDeploy bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@nina-ctrlv
Copy link

Describe the bug

In #23591, InstallLatestAwsSdk had its default changed to false for custom resources. There is a flag that allows overriding the default, but that is only applicable for when creating a custom resource directly. The change also updated several L3 constructs such as CustomLambdaDeploymentConfig that create a custom resource and hardcoded the InstallLatestAwsSdk to false. The flag is only applied if a prop is not assigned so that behavior cannot be overridden. This is causing the resource to be updated but since the name is not changed, it tries to create the same deployment config which fails. We could rename the deployment config, but this is not rollback safe so it would be high risk. We could also remove traffic shifting altogether then update the version and add back traffic shifting, but this is also high risk and time consuming.

Expected Behavior

Be able to update the the aws-cdk version without the custom resource trying update and create a new deployment config

Current Behavior

The custom resource is updated since the InstallLatestAwsSdk is changing which causes the resource to try to create a new deployment config even though the deployment config is not changing

Reproduction Steps

Deploy with cdk version 2.59 or earlier and then try to deploy again with version 2.60 or greater

Possible Solution

Some options are:

  1. Potentially swallow already exist exceptions (pro: this will allow any other updates to the custom resource that aren't intending to update the config itself can be done without interruption, con: this could unintentionally cause people to use the wrong config. This could probably be combatted by being able to set the behavior with a prop that is set for the construct where the default is that the exception is not swallowed)
  2. Allow the InstallLatestAwsSdk to be overridden in the CustomLambdaDeploymentConfig by it being a prop option (pro: does not depend on the flag which may go away in the future, con: not similar to the other L3 constructs)
  3. Make it so that the flag will override the custom lambda deployment config (pro: don't need to add it to the prop, con: flag may go away at some point and this will affect everyone who currently has the flag set to a specific value and may cause unnecessary updates as well)

Additional Information/Context

No response

CDK CLI Version

(not sure if that's different from aws-cdk)

Framework Version

No response

Node.js Version

16.x

OS

mac

Language

Typescript

Language Version

No response

Other information

No response

@nina-ctrlv nina-ctrlv added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 2, 2023
@github-actions github-actions bot added the @aws-cdk/aws-codedeploy Related to AWS CodeDeploy label Jun 2, 2023
@pahud pahud self-assigned this Jun 5, 2023
@pahud
Copy link
Contributor

pahud commented Jun 5, 2023

Agree. This seems to be a breaking change which causes the custom resource update.

@pahud pahud added p1 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jun 5, 2023
@pahud pahud removed their assignment Jun 5, 2023
@pahud pahud added p2 and removed p1 labels Jun 11, 2024
@TheRealAmazonKendra
Copy link
Contributor

This construct is deprecated. We suggest that you move to LambdaDeploymentConfig instead. From my testing of something unrelated, I have discovered that any update to the underlying custom resource will cause breakages as this construct attempts to replace the resource instead of updating it due to no api existing for updates. The only way to perform an update is to rename it.

@TheRealAmazonKendra TheRealAmazonKendra added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jul 4, 2024
Copy link

github-actions bot commented Jul 7, 2024

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codedeploy Related to AWS CodeDeploy bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants