Random Number random_number

The random_number resource allows the creation of random numbers.

Properties

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

    The minimum number to generate.

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

    The maximum number to generate.

  • Name
    value
    Type
    (int: )
    Required
    Readonly
    readonly
    Description

    The generated random number.

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_number" "port" {
  minimum = 10000
  maximum = 20000
}

output "random_number" {
  value = resource.random_number.port.value
}