-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathrandom.tf
44 lines (39 loc) · 1.87 KB
/
random.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
///////////////////////////////////////////////////[ RANDOM STRING GENERATOR ]////////////////////////////////////////////
# # ---------------------------------------------------------------------------------------------------------------------#
# Generate random uuid string that is intended to be used as secret header
# # ---------------------------------------------------------------------------------------------------------------------#
resource "random_uuid" "this" {}
# # ---------------------------------------------------------------------------------------------------------------------#
# Generate random passwords
# # ---------------------------------------------------------------------------------------------------------------------#
resource "random_password" "this" {
for_each = toset(var.password)
length = 16
lower = true
upper = true
numeric = true
special = true
override_special = "!&#$"
}
# # ---------------------------------------------------------------------------------------------------------------------#
# Generate random string
# # ---------------------------------------------------------------------------------------------------------------------#
resource "random_string" "this" {
for_each = toset(var.string)
length = 7
lower = true
numeric = true
special = false
upper = false
}
# # ---------------------------------------------------------------------------------------------------------------------#
# Generate random stirng for s3
# # ---------------------------------------------------------------------------------------------------------------------#
resource "random_string" "s3" {
for_each = var.s3
length = 7
lower = true
numeric = true
special = false
upper = false
}