We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eef95e7 commit 13dafcfCopy full SHA for 13dafcf
2 files changed
aws/tf/connection_url.tf
@@ -1,6 +1,7 @@
1
resource "aws_secretsmanager_secret" "db_admin_pg" {
2
- name = "${var.name}/conn_url"
3
- tags = var.tags
+ name = "${var.name}/conn_url"
+ tags = var.tags
4
+ recovery_window_in_days = var.is_prod_env ? 7 : 0
5
}
6
7
resource "aws_secretsmanager_secret_version" "db_admin_pg" {
aws/tf/variables.tf
@@ -35,6 +35,16 @@ variable "password" {
35
type = string
36
37
38
+variable "is_prod_env" {
39
+ type = bool
40
+ default = true
41
+ description = <<EOF
42
+When destroying, is_prod_env determines the recovery window for the admin password secret.
43
+If true, a 7-day recovery window will be configured.
44
+If not, secret will be deleted immediately.
45
+EOF
46
+}
47
+
48
variable "network" {
49
description = <<EOF
50
Network configuration.
0 commit comments