Add name_prefix attribute to aws_secretsmanager_secret #6054
Labels
enhancement
Requests to existing resources that expand the functionality or scope.
service/secretsmanager
Issues and PRs that pertain to the secretsmanager service.
Milestone
Community Note
Description
AWS secrets are by default kept around for a few days after being deleted so they can be recovered. This causes creation of
aws_secretsmanager_secret
resources to fail when doing aterraform apply
immediately after aterraform destroy
, since the secret still exists in AWS (even though it is marked for deletion). The recommended terraform solution is to setrecovery_window_in_days = 0
so that the secret is deleted immediately on destroy.For some use cases we want the extra protection that
recovery_window_in_days > 0
provides, so we don't accidentally blow away an important secret. In those cases it'd be helpful to usename_prefix
to still allow a new version of the secret to be deleted before the old version has expired.New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: