forked from ulamlabs/terraform-aws-rabbitmq
-
Notifications
You must be signed in to change notification settings - Fork 1
/
secrets.tf
115 lines (93 loc) · 2.71 KB
/
secrets.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
resource "aws_ssm_parameter" "datadog_api_key" {
name = "/${var.name}/DATADOG_API_KEY"
type = "SecureString"
value = "Add Datadog API Key Here"
key_id = var.kms_key_arn
lifecycle {
ignore_changes = [value]
}
tags = var.tags
}
resource "aws_ssm_parameter" "datadog_user_password" {
name = "/${var.name}/DATADOG_PASSWORD"
type = "SecureString"
value = random_password.datadog_password.result
key_id = var.kms_key_arn
tags = var.tags
}
resource "aws_ssm_parameter" "rabbit_admin_password" {
name = "/${var.name}/ADMIN_PASSWORD"
type = "SecureString"
value = random_password.admin_password.result
key_id = var.kms_key_arn
tags = var.tags
}
resource "aws_ssm_parameter" "rabbit_password" {
name = "/${var.name}/RABBIT_PASSWORD"
type = "SecureString"
value = random_password.rabbit_password.result
key_id = var.kms_key_arn
tags = var.tags
}
resource "aws_ssm_parameter" "secret_cookie" {
name = "/${var.name}/SECRET_COOKIE"
type = "SecureString"
value = random_password.secret_cookie.result
key_id = var.kms_key_arn
tags = var.tags
}
resource "random_password" "admin_password" {
length = 32
special = false
}
resource "random_password" "rabbit_password" {
length = 32
special = false
}
resource "random_password" "secret_cookie" {
length = 64
special = false
}
resource "random_password" "datadog_password" {
length = 64
special = false
}
resource "aws_ssm_parameter" "secondary_datadog_user_password" {
count = var.enable_password_rotation ? 1 : 0
name = "/${var.name}/SECONDARY_DATADOG_PASSWORD"
type = "SecureString"
value = random_password.secondary_datadog_password[0].result
key_id = var.kms_key_arn
tags = var.tags
}
resource "aws_ssm_parameter" "secondary_rabbit_admin_password" {
count = var.enable_password_rotation ? 1 : 0
name = "/${var.name}/SECONDARY_ADMIN_PASSWORD"
type = "SecureString"
value = random_password.secondary_admin_password[0].result
key_id = var.kms_key_arn
tags = var.tags
}
resource "aws_ssm_parameter" "secondary_rabbit_password" {
count = var.enable_password_rotation ? 1 : 0
name = "/${var.name}/SECONDARY_RABBIT_PASSWORD"
type = "SecureString"
value = random_password.secondary_rabbit_password[0].result
key_id = var.kms_key_arn
tags = var.tags
}
resource "random_password" "secondary_admin_password" {
count = var.enable_password_rotation ? 1 : 0
length = 32
special = false
}
resource "random_password" "secondary_rabbit_password" {
count = var.enable_password_rotation ? 1 : 0
length = 32
special = false
}
resource "random_password" "secondary_datadog_password" {
count = var.enable_password_rotation ? 1 : 0
length = 64
special = false
}