-
Notifications
You must be signed in to change notification settings - Fork 4k
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-cdk-lib/aws-secretsmanager: Secret already exists in another stack #24657
Comments
Hi Where is the Can you share more details? const dbCredentials = secretsmanager.Secret.fromSecretNameV2(stack, 'DBSecret', 'secret-name');
const database = new rds.DatabaseInstance(stack, 'database-name', {
credentials: rds.Credentials.fromSecret(credentials),
removalPolicy: RemovalPolicy.RETAIN,
engine: rds.DatabaseInstanceEngine.postgres({ version: postgresVersion })
...
}
}); |
@pahud sorry, I just modified the description, its the one being retrieved from secrets manager:
|
Any updates? |
Let me know if it works with you. |
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. |
Describe the bug
We are trying to deploy new stacks with aws-cdk referencing a secret to attach credentials to an RDS instance and we are getting the following error (only happens with new stacks):
❌ Error: The stack named new_stack_name failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: arn:aws:secretsmanager:us-east-2:<*****accountd_id*****>:secret:<*****secret_arn*****> already exists in stack arn:aws:cloudformation:us-east-2:<*****accountd_id*****>:stack/<*****existing_stack_name*****>/<*****existing_stack_id*****>
This error started happening one month ago without any changes from our side, before this we were able to deploy the same infrastructure for existing and new stacks.
The following code is getting the secret from secrets manager and attaching this secret to the RDS instance:
Expected Behavior
The database and secret attachment is created successfully
Current Behavior
The deployment of a new stack fails when it tries to create the Secret Attachment for the RDS instance
Reproduction Steps
Described above.
Possible Solution
I tried to follow the steps described in #24383 but its still happening
Additional Information/Context
No response
CDK CLI Version
2.67.0
Framework Version
No response
Node.js Version
16.0
OS
Ubuntu
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: