Skip to content

Latest commit

 

History

History
68 lines (52 loc) · 3.38 KB

File metadata and controls

68 lines (52 loc) · 3.38 KB
page_title subcategory description
random_password Resource - terraform-provider-random
Identical to random_string string.html with the exception that the result is treated as sensitive and, thus, not displayed in console output. Read more about sensitive data handling in the Terraform documentation https://www.terraform.io/docs/language/state/sensitive-data.html. This resource does use a cryptographic random number generator.

random_password (Resource)

Identical to random_string with the exception that the result is treated as sensitive and, thus, not displayed in console output. Read more about sensitive data handling in the Terraform documentation.

This resource does use a cryptographic random number generator.

Example Usage

resource "random_password" "password" {
  length           = 16
  special          = true
  override_special = "!#$%&*()-_=+[]{}<>:?"
}

resource "aws_db_instance" "example" {
  instance_class    = "db.t3.micro"
  allocated_storage = 64
  engine            = "mysql"
  username          = "someone"
  password          = random_password.password.result
}

Schema

Required

  • length (Number) The length of the string desired. The minimum value for length is 1 and, length must also be >= (min_upper + min_lower + min_numeric + min_special).

Optional

  • keepers (Map of String) Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
  • lower (Boolean) Include lowercase alphabet characters in the result. Default value is true.
  • min_lower (Number) Minimum number of lowercase alphabet characters in the result. Default value is 0.
  • min_numeric (Number) Minimum number of numeric characters in the result. Default value is 0.
  • min_special (Number) Minimum number of special characters in the result. Default value is 0.
  • min_upper (Number) Minimum number of uppercase alphabet characters in the result. Default value is 0.
  • number (Boolean, Deprecated) Include numeric characters in the result. Default value is true. NOTE: This is deprecated, use numeric instead.
  • numeric (Boolean) Include numeric characters in the result. Default value is true.
  • override_special (String) Supply your own list of special characters to use for string generation. This overrides the default character list in the special argument. The special argument must still be set to true for any overwritten characters to be used in generation.
  • special (Boolean) Include special characters in the result. These are !@#$%&*()-_=+[]{}<>:?. Default value is true.
  • upper (Boolean) Include uppercase alphabet characters in the result. Default value is true.

Read-Only

  • bcrypt_hash (String, Sensitive) A bcrypt hash of the generated random string.
  • id (String) A static value used internally by Terraform, this should not be referenced in configurations.
  • result (String, Sensitive) The generated random string.

Import

Import is supported using the following syntax:

# Random Password can be imported by specifying the value of the string:
terraform import random_password.password securepassword