File tree Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ Example:
88
99```
1010module "random_password" {
11- source = "git::https://github.com/rhythmictech/terraform-aws-secretsmanager-secret"
12- name_prefix = "RDSPassword"
13- description = "RDS instance master password"
14- length = 20
15- override_special = "@#$%^*()-=_+[]{};<>?,./"
11+ source = "git::https://github.com/rhythmictech/terraform-aws-secretsmanager-secret"
12+ name_prefix = "RDSPassword"
13+ description = "RDS instance master password"
14+ length = 20
15+ override_special = "@#$%^*()-=_+[]{};<>?,./"
1616}
1717```
1818
@@ -48,6 +48,7 @@ module "random_password" {
4848| name\_ prefix | Name Prefix (not used if name specified) | ` string ` | ` "terraform" ` | no |
4949| override\_ special | n/a | ` string ` | ` "" ` | no |
5050| pass\_ version | Password version. Increment this to trigger a new password. | ` number ` | ` 1 ` | no |
51+ | recovery_window_in_days | Number of days to wait before deleting the secret | ` number ` | ` "30" ` | no |
5152| secret\_ access\_ metric\_ namespace | Metric namespace to use for CloudWatch metric | ` string ` | ` "SecretsManager" ` | no |
5253| secret\_ access\_ notification\_ arn | SNS topic to notify on secret access (required if ` enable_secret_access_notification=true ` ) | ` string ` | ` "" ` | no |
5354| tags | Tags to add to supported resources | ` map(string) ` | ` {} ` | no |
Original file line number Diff line number Diff line change @@ -23,12 +23,13 @@ resource "random_password" "random_string" {
2323}
2424
2525resource "aws_secretsmanager_secret" "secret" {
26- count = var. create_secret ? 1 : 0
27- name = var. name == " " ? null : var. name
28- name_prefix = var. name == " " ? var. name_prefix : null
29- description = var. description
30- kms_key_id = var. kms_key_id
31- tags = var. tags
26+ count = var. create_secret ? 1 : 0
27+ name = var. name == " " ? null : var. name
28+ name_prefix = var. name == " " ? var. name_prefix : null
29+ description = var. description
30+ kms_key_id = var. kms_key_id
31+ recovery_window_in_days = var. recovery_window_in_days
32+ tags = var. tags
3233}
3334
3435resource "aws_secretsmanager_secret_version" "secret_val" {
Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ variable "pass_version" {
3636 type = number
3737}
3838
39+ variable "recovery_window_in_days" {
40+ default = 30
41+ description = " Number of days that AWS Secrets Manager waits before it can delete the secret."
42+ type = number
43+ }
44+
3945variable "tags" {
4046 default = {}
4147 description = " Tags to add to supported resources"
You can’t perform that action at this time.
0 commit comments