-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
[Bug]: Inconsistent Behavior of AWS Secret ID's #32157
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Hey @wschult23 👋 Thank you for taking the time to raise this! This is an interesting corner case that seems to be caused by the underlying read function ( In normal operation, the Normally, providing something other than what's expected during import (and thus setting In the short term, the fix for this is to import the |
Hey @justinretzolk, Best, Wolfgang. |
Hey @wschult23 👋 In this case, │ Error: "arn" (test-secret) is an invalid ARN: arn: invalid prefix
│
│ with data.aws_secretsmanager_secret.test, The issue in this case is incorrectly importing the |
Hey @justinretzolk, |
Terraform Core Version
1.4.5
AWS Provider Version
5.4.0
Affected Resource(s)
aws_secretsmanager_secret
data.aws_secretsmanager_secret
Expected Behavior
The usage of the 'id' attribute should be consistent.
Actual Behavior
The resource changes the meaning of "id" depending of the lifecycle of the
aws_secretsmanager_secret
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
Now delete the secret:
Resurrect it and try to import it manually:
When you now try to reimport the secret, the following error occurs on the data source:
You can workaround this by fixing line number 6 to:
Now you can apply again, but you cannot go back to the code that was originally working.
Debug Output
No response
Panic Output
No response
Important Factoids
It seems that the root cause is that the Amazon API accepts secret names instead of ARN's as long as they are unique. When you delete and restore a secret, it's probably no longer the case.
References
https://docs.aws.amazon.com/cli/latest/reference/secretsmanager/index.html
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: