Through automation, we updated a secrets manager secret. The aws_secretsmanager_secret_version should have identified the change, updating the secret version_id.
Actual Behavior
The password update is never reflected in terraform, and the data source is still tied to the old secret version. terraform state show 'address' displays this:
Please note the version_id ="ADABF743-5579-4973-A1FF-BB1F471E1465" whereas the version_id that actually has the stage label AWSCURRENT is terraform-20240724211504641600000001.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
data "aws_secretsmanager_secret" "secret" {
provider = aws.env_secrets
name = "mysecret"
}
data "aws_secretsmanager_secret_version" "secret_version" {
provider = aws.env_secrets
secret_id = data.aws_secretsmanager_secret.mysecret.id
}
Steps to Reproduce
Create an aws secrets manager secret, then reference it in terraform via the aws_secretsmanager_secret_version data source. Run terraform apply. Update the secret, making sure there are two secret versions. Run terraform apply again.
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Terraform Core Version
v1.8.2
AWS Provider Version
v5.36.0
Affected Resource(s)
Expected Behavior
Through automation, we updated a secrets manager secret. The aws_secretsmanager_secret_version should have identified the change, updating the secret version_id.
Actual Behavior
The password update is never reflected in terraform, and the data source is still tied to the old secret version.
terraform state show 'address'
displays this:Please note the
version_id ="ADABF743-5579-4973-A1FF-BB1F471E1465"
whereas the version_id that actually has the stage labelAWSCURRENT
isterraform-20240724211504641600000001
.Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
Create an aws secrets manager secret, then reference it in terraform via the aws_secretsmanager_secret_version data source. Run
terraform apply
. Update the secret, making sure there are two secret versions. Runterraform apply
again.Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None