Terraform module for Random Password
This is a stable example. It should successfully build out of the box
Note: Requires random provider version >= 2.2.0
Note: All attributes including the generated password will be stored in the raw state as plain-text. Read more about sensitive data in state.
This module may be used to create Random String resources in .....
Identical to random_string with the exception that the result is treated as sensitive and, thus, not displayed in console output.
This module needs Terraform 0.12.23 or newer. You can download the latest Terraform version from here.
This module deploys aws services details are in respective feature branches.
Below we are able to check the resources that are being created as part of this module call:
- Random Password
To use this module, add the following call to your code:
module "random_password" {
source = "git::https://github.com/nitinda/terraform-module-random-password.git?ref=master"
# Providers
providers = {
random = random.services
}
length = 23
special = false
min_upper = 23
}
module "random_password" {
source = "git::https://github.com/nitinda/terraform-module-random-password.git?ref=master"
# Providers
providers = {
random = random.services
}
length = 16
special = true
override_special = "/@£$"
}
The variables that required in order for the module to be successfully called from the layers are the following:
Variable | Description | Type | Argument Status | Default Value |
---|---|---|---|---|
length | The length of the string desired | string | Required | |
upper | Include uppercase alphabet characters in random string | boolean | Optional | true |
min_upper | Minimum number of uppercase alphabet characters in random string | number | Optional | 0 |
lower | Include lowercase alphabet characters in random string | boolean | Optional | true |
min_lower | Minimum number of lowercase alphabet characters in random string | number | Optional | 0 |
number | An Action block | boolean | Optional | true |
min_numeric | Minimum number of numeric characters in random string | number | Optional | 0 |
special | Include special characters in random string. These are **!@#$%&*()-_=+[]{}<>:?** | boolean | Optional | true |
min_special | Minimum number of special characters in random string | boolean | Optional | 0 |
override_special | Supply your own list of special characters to use for string generation. This overrides the default character list in the special argument | string | Optional | null |
keepers | Arbitrary map of values that, when changed, will trigger a new id to be generated.See the main provider documentation for more information | map(string) | Optional | null |
This module has the following outputs:
- result
In order for the variables to be accessed at module level please use the syntax below:
module.<module_name>.<output_variable_name>
The output variable is able to be accessed through terraform state file using the syntax below:
data.terraform_remote_state.<layer_name>.<output_variable_name>
Module maintained by Module maintained by the - Nitin Das