terraform resource aws_secretsmanager_secret_version generated incorrect output
rorourke-iot opened this issue · comments
rorourke-iot commented
The resource for an AWS secret was generated as
resource "aws_secretsmanager_secret" "SecretsManagerSecret" {
name = "mySecret-XXX"
description = "IAM Access Key Secret"
tags = {}
}
resource "aws_secretsmanager_secret_version" "SecretsManagerSecretVersion" {
secret_id = "arn:aws:secretsmanager:us-east-1:794459195369:secret:mySecret-XXX-YYY"
secret_string = "<secrete string>"
}
When using this to apply a plan, the output included the message: Error: putting Secrets Manager Secret value: ResourceNotFoundException: Secrets Manager can't find the specified secret.
According to the docs, the value for secret_id
is best represented as aws_secretsmanager_secret.SecretsManagerSecret.id
.
Ian Mckay commented
Hi @rorourke-iot,
Thanks for raising. I've added an extra attribute mapping that should hopefully reference the secret_id as you say. Let me know how that goes for you.