Random Password random_password

The random_password resource allows the creation of random passwords.

Properties

  • Name
    length
    Type
    (int: )
    Required
    required
    Readonly
    Description

    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).

  • Name
    special
    Type
    (bool: true)
    Required
    Readonly
    Description

    Include special characters in the result. These are !@#$%&*()-_=+[]{}<>:?.

  • Name
    min_special
    Type
    (int: 0)
    Required
    Readonly
    Description

    Minimum number of special characters in the result.

  • Name
    override_special
    Type
    (string: "")
    Required
    Readonly
    Description

    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.

  • Name
    numeric
    Type
    (bool: true)
    Required
    Readonly
    Description

    Include numeric characters in the result.

  • Name
    min_numeric
    Type
    (int: 0)
    Required
    Readonly
    Description

    Minimum number of numeric characters in the result.

  • Name
    lower
    Type
    (bool: true)
    Required
    Readonly
    Description

    Include lowercase alphabet characters in the result.

  • Name
    min_lower
    Type
    (int: 0)
    Required
    Readonly
    Description

    Minimum number of lowercase alphabet characters in the result.

  • Name
    upper
    Type
    (bool: true)
    Required
    Readonly
    Description

    Include uppercase alphabet characters in the result.

  • Name
    min_upper
    Type
    (int: 0)
    Required
    Readonly
    Description

    Minimum number of uppercase alphabet characters in the result.

  • Name
    value
    Type
    (string: "")
    Required
    Readonly
    readonly
    Description

    The generated random password.

Meta Properties

In addition to the main properties, all resources have meta properties, such as the id of the resource. To see the list of these properties please see the Meta Properties section in the documentation /docs/resources/meta.

Examples

resource "random_password" "password" {
    length = 32
}

output "password" {
    value = resource.random_password.password.value
}