This module generates random credentials and hashes that can be used in various applications.
Name | Version |
---|---|
random | 3.5.0 |
time | 0.9.1 |
Name | Version |
---|---|
random | 3.5.0 |
time | 0.9.1 |
No modules.
Name | Type |
---|---|
random_password.multiple | resource |
random_password.single | resource |
time_rotating.multiple | resource |
time_rotating.single | resource |
time_static.multiple | resource |
time_static.single | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
experation | A number, in days, when the password should be rotated. If none is set, the password will not rotate. | number |
0 |
no |
names | List of unique names for the multiple resources. | list(string) |
[] |
no |
passwords | A map of objects with password settings. | any |
n/a | yes |
per_workspace | Generate a password for each workspace. | bool |
false |
no |
Name | Description |
---|---|
results | A map(string) with the following attributes: result, md5, sha1sha256, and sha512. |
module "random" {
source = "./modules/random"
names = ["dev", "stage", "prod"]
passwords = local.env.passwords
}
Passwords to be generated are set in local.env.passwords
.
locals {
env = {
...
workspace_name = {
...
passwords = {
password1 = {
length = 16
special = false
}
}
}
}
}
If the attribute per_workspace
is set for true
, then multiple
resources will be created. It will prefix each resource name with each workspace name. It is useful to set this in the bootstrap
"environment", allowing the passwords to be added as pipeline variables for each environment.
locals {
env = {
...
bootstrap = {
...
passwords = {
password2 = {
length = 32
per_workspace = true
}
}
}
}
}
If the per_workspace
value isn't set or is false
, only single
resource will be created.