-
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(apigateway): cannot remove first api key from usage plan #13817
Conversation
The UsagePlanKey resource connects an ApiKey with a UsagePlan. The API Gateway service does not allow more than one UsagePlanKey for any given UsagePlan and ApiKey combination. For this reason, CloudFormation cannot replace this resource without either the UsagePlan or ApiKey changing. A feature was added back in Nov 2019 - 142bd0e - that allows multiple UsagePlanKey resources. The above limitation was recognized and logical id of the existing UsagePlanKey was retained. However, this unintentionally caused the logical id of the UsagePlanKey to be sensitive to order. That is, when the 'first' UsagePlanKey resource is removed, the logical id of the what was the 'second' UsagePlanKey is changed to be the logical id of what was the 'first'. This change to the logical id is, again, disallowed. To get out of this mess, two things are done - 1. introduce a feature flag that changes the default behaviour for all new CDK apps. 2. for customers with existing CDK apps who are would want to remove UsagePlanKey resource, introduce a 'overrideLogicalId' option that they can manually configure with the existing logical id. fixes #11876
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
The UsagePlanKey resource connects an ApiKey with a UsagePlan. The API Gateway service does not allow more than one UsagePlanKey for any given UsagePlan and ApiKey combination. For this reason, CloudFormation cannot replace this resource without either the UsagePlan or ApiKey changing. A feature was added back in Nov 2019 - 142bd0e - that allows multiple UsagePlanKey resources. The above limitation was recognized and logical id of the existing UsagePlanKey was retained. However, this unintentionally caused the logical id of the UsagePlanKey to be sensitive to order. That is, when the 'first' UsagePlanKey resource is removed, the logical id of the what was the 'second' UsagePlanKey is changed to be the logical id of what was the 'first'. This change to the logical id is, again, disallowed. To get out of this mess, we do two things - 1. introduce a feature flag that changes the default behaviour for all new CDK apps. 2. for customers with existing CDK apps who are would want to remove UsagePlanKey resource, introduce a 'overrideLogicalId' option that they can manually configure with the existing logical id. fixes aws#11876 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
The UsagePlanKey resource connects an ApiKey with a UsagePlan. The API
Gateway service does not allow more than one UsagePlanKey for any given
UsagePlan and ApiKey combination. For this reason, CloudFormation cannot
replace this resource without either the UsagePlan or ApiKey changing.
A feature was added back in Nov 2019 - 142bd0e - that allows multiple
UsagePlanKey resources. The above limitation was recognized and logical
id of the existing UsagePlanKey was retained.
However, this unintentionally caused the logical id of the UsagePlanKey
to be sensitive to order. That is, when the 'first' UsagePlanKey
resource is removed, the logical id of the what was the 'second'
UsagePlanKey is changed to be the logical id of what was the 'first'.
This change to the logical id is, again, disallowed.
To get out of this mess, we do two things -
introduce a feature flag that changes the default behaviour for all
new CDK apps.
for customers with existing CDK apps who are would want to remove
UsagePlanKey resource, introduce a 'overrideLogicalId' option that they
can manually configure with the existing logical id.
fixes #11876
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license