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" {
│
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.