-
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
[secretsmanager] object.secret.secret_name returns the end of the ARN not the Secrets name #11573
Comments
https://github.com/aws/aws-cdk/pull/11202/files#r517667089
I think I just found a way where I want the secret name used without the extra suffix. And if we look at the console it uses the shortened secret name: |
Hi @gergnz . Can you help me understand a bit more about your use case?
At the surface, there is no (simple) way to get the "friendly" secret name from a secret that's just been created; it's not one of the return values from CloudFormation, and needs to be parsed from the ARN. A custom resource could take the full ARN and calculate the "friendly" secret name, but it's unclear what value that provides. Perhaps if I understood more about your use case I could make a different suggestion?
Does this mean you found a workaround that works for you? Would you mind sharing what you've done? |
Because I swear I tried and couldn't see that I could use the ARN. Have now tried again, and that works.
yes, I went through the code and can see that. I was thinking you could wrap the ParseArn that sets up a Fn::Select, with another Fn::Select to try and drop the suffix, but wasn't coming up with a solid way to achieve that in a sane way.
Negative I have not found a good workaround that would be consistent. Given that I have now retried ARN, I have a way forward and don't immediately see a need for the name for my needs. Thanks for getting back to me and sorry for the noise. |
|
When creating and RDS Instance it creates a secret for the DB. When trying to use that secret later I expect to be able to use the Secret name and the ARN correctly, but the secret name is being returned as the last item of the ARN with the extra suffix, which is incorrect.
Reproduction Steps
What did you expect to happen?
I expect that /tmp/details is populated with the value stored in the secrets manager for that name.
I want to get the value out of secrets manager.
What actually happened?
the user data of the instance gets populated with the name:
dbSecret8003E3A7-mIXuhO5ONwLb-qeNyUO
but the name should be:
dbSecret8003E3A7-mIXuhO5ONwLb
the ARN in the policy is correct:
arn:aws:secretsmanager:ap-southeast-2:025705368789:secret:dbSecret8003E3A7-mIXuhO5ONwLb-qeNyUO
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: