Instruqt Labs (beta)
  • Instruqt
  • Getting started
    • Setting up Version Control
    • Install Instruqt CLI
    • Creating your first lab
    • Configuration basics
    • Exploring the lab configuration
    • Adding your first chapter
    • Configuring sandboxes
    • Adding quizzes
    • Adding tasks and gating content
    • Finishing up
  • Documentation
    • Writing Lab Content
      • Project Structure
      • Markdown and Components
    • Integrations
      • Version Control
    • Lab reference
      • Content
        • Lab
        • Page
        • Activities
          • Task
          • Quiz
            • Multiple Choice
            • Single Choice
            • Text Answer
            • Numeric Answer
        • Layout
        • Tabs
          • Terminal
          • Service
          • Editor
          • External Website
          • Note
      • Sandbox
        • Containers
          • Container
          • Sidecar Container
        • Kubernetes
          • Cluster
          • Config
          • Helm
        • Nomad
          • Cluster
          • Job
        • Networking
          • Network
          • Ingress
        • Cloud Accounts
          • AWS
          • Azure
          • Google Cloud
        • Terraform
        • Template
        • Exec
        • Copy
        • Certificates
          • Root
          • Leaf
        • Random
          • Number
          • ID
          • UUID
          • Password
          • Creature
      • Functions
    • Tools
      • Instruqt CLI
    • Glossary
Powered by GitBook
On this page
  • RandomPassword
  • Examples
Edit on GitHub
Export as PDF
  1. Documentation
  2. Lab reference
  3. Sandbox
  4. Random

Password

RandomPassword

The random_password resource allows the creation of random passwords.


resource "random_password" "name" {
  ...
}

Attributes

Attribute
Description

Length length required type: int64

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

OverrideSpecial override_special type: 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 special type: bool default: true

@#$%&*()-_=+[]{}<>:?`.

Numeric numeric type: bool default: true

Include numeric characters in the result.

Lower lower type: bool default: true

Include lowercase alphabet characters in the result.

Upper upper type: bool default: true

Include uppercase alphabet characters in the result.

MinSpecial min_special type: int64 default: 0

Minimum number of special characters in the result.

MinNumeric min_numeric type: int64 default: 0

Minimum number of numeric characters in the result.

MinLower min_lower type: int64 default: 0

Minimum number of lowercase alphabet characters in the result.

MinUpper min_upper type: int64 default: 0

Minimum number of uppercase alphabet characters in the result.

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.

Attribute
Description

Meta ID meta.id string

The full ID of the resource e.g. `resource.type.name`. This is computed from the full resource path:

Meta Type meta.type string

The type of the resource. This taken from the type label of the resource definition.

Meta Name meta.name string

The name of the resource. This taken from the name label of the resource definition.

Value value type: string

The generated random password.

Examples


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

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

Last updated 1 month ago

length = 32
override_special = "!*()"
special = true
numeric = true
lower = true
upper = true
min_special = 4
min_numeric = 4
min_lower = 4
min_upper = 4
// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting id will be
resource.container.ubuntu
// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting type will be
container
// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting name will be
ubuntu