lgallard / terraform-aws-secrets-manager

Terraform module to create Amazon Secrets Manager resources.
Apache License 2.0
63 stars 50 forks source link

Update secret version and secret rotation to support using name_prefix #39

Closed bensharp1 closed 12 months ago

bensharp1 commented 12 months ago

Currently, secret version and secret rotation resources are set to each.key, which does not take into account the supported name_prefix parameter that can be set in the secrets' creation. As such, when name_prefix is set, the version and rotation resources fail to create, as the referenced secret_id does not exist.

│ Error: putting Secrets Manager Secret value: ResourceNotFoundException: Secrets Manager can't find the specified secret. │ │ with module.users_secrets[0].aws_secretsmanager_secret_version.rsm-svu["example-secret"], │ on .terraform/modules/users_secrets/main.tf line 75, in resource "aws_secretsmanager_secret_version" "rsm-svu": │ 75: resource "aws_secretsmanager_secret_version" "rsm-svu" { │

lgallard commented 12 months ago

@bensharp1 thanks for this fix!!