-
Notifications
You must be signed in to change notification settings - Fork 822
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: remove parameters when resource is deleted or unlinked #12544
Conversation
packages/amplify-provider-awscloudformation/src/utils/ssm-utils/delete-ssm-parameters.ts
Outdated
Show resolved
Hide resolved
@@ -480,7 +480,10 @@ export const run = async (context: $TSContext, resourceDefinition: $TSObject, re | |||
.map(({ category, resourceName }) => context.amplify.removeDeploymentSecrets(context, category, resourceName)); | |||
|
|||
await adminModelgen(context, resources); | |||
|
|||
await deleteEnvironmentParametersForResources(context, context.amplify.getEnvInfo().envName, [ |
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.
await deleteEnvironmentParametersForResources(context, context.amplify.getEnvInfo().envName, [ | |
await deleteEnvironmentParametersForResources(context, [ |
envInfo we can fetch inside the function?
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.
That would limit the use of the function to the current environment. I updated to use stateManager to resolve the current envName.
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## dev #12544 +/- ##
===========================================
+ Coverage 0.00% 47.59% +47.59%
===========================================
Files 1296 842 -454
Lines 149743 38323 -111420
Branches 1296 7835 +6539
===========================================
+ Hits 0 18241 +18241
+ Misses 148447 18459 -129988
- Partials 1296 1623 +327
... and 1273 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
lgtm
Description of changes
Add a step a the end of
amplify push
to remove parameters from Parameter Store for any resources that were removed during push.Issue #, if available
Fixes #12385
Description of how you validated changes
e2e test passes locally, also manually verified correct parameters are removed
Passing e2e run
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.