You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a previously deployed nitric AWS stack, which includes a secret, changes the secret to be an imported secret an error occurs due to duplicate resource name resolution.
The cause is that the original secret is deleted and replaced with the imported secret. However, AWS Secrets Manager doesn't immediately delete secrets, instead they are soft deleted and removed after a number of days. In the meantime both secrets exist, tagged with the same nitric name. This causes the nitric runtime code to fail to uniquely identity which is the correct secret to use.
This issue can be confirmed by looking at the Secrets Manager dashboard, which will only show the imported secret:
However, viewing the resource group for the stack will show both the imported secret and the soft deleted secret:
Steps
Steps to reproduce the behavior:
Create a new nitric project
Add a secret to the project (e.g.)
Create a new AWS stack
Deploy the stack
Create a secret manually in AWS Secrets Manager
Update the stack file to import the manually created secret (using the name for the existing secret in the application code)
Redeploy the stack
If the stack hasn't been deployed previously, imports won't cause an issue
Expected
The soft deleted secret should be untagged or otherwise identified so that it isn't returned when attempting to resolve resource names.
Workaround
When redeploying a stack with an existing secret that is being replaced by an imported secret, rename the secret in the code (and stack file) before redeploying. This ensures the newly imported secret's name won't conflict with the soft deleted secret.
Eventually the soft deleted secret will be deleted and the issue with resolve on its own
The text was updated successfully, but these errors were encountered:
Bug Report
Issue
When a previously deployed nitric AWS stack, which includes a secret, changes the secret to be an imported secret an error occurs due to duplicate resource name resolution.
The cause is that the original secret is deleted and replaced with the imported secret. However, AWS Secrets Manager doesn't immediately delete secrets, instead they are soft deleted and removed after a number of days. In the meantime both secrets exist, tagged with the same nitric name. This causes the nitric runtime code to fail to uniquely identity which is the correct secret to use.
This issue can be confirmed by looking at the Secrets Manager dashboard, which will only show the imported secret:
However, viewing the resource group for the stack will show both the imported secret and the soft deleted secret:
Steps
Steps to reproduce the behavior:
Expected
The soft deleted secret should be untagged or otherwise identified so that it isn't returned when attempting to resolve resource names.
Workaround
When redeploying a stack with an existing secret that is being replaced by an imported secret, rename the secret in the code (and stack file) before redeploying. This ensures the newly imported secret's name won't conflict with the soft deleted secret.
The text was updated successfully, but these errors were encountered: