Number
RandomNumber
Section titled “RandomNumber”The random_number
resource allows the creation of random numbers.
resource "random_number" "name" { ...}
Attributes
Section titled “Attributes”Attribute | Description |
---|---|
Minimum | The minimum number to generate.
|
Maximum | The maximum number to generate.
|
Computed Attributes
Section titled “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 | The full ID of the resource e.g.
|
resource “container” “ubuntu” { | |
… | |
} |
// the resulting id will be resource.container.ubuntu | |
Meta Type meta.type
string
The type of the resource.
This taken from the type label of the resource definition.
| |// given the following resource resource “container” “ubuntu” { … }
// the resulting type will be container
Meta Name meta.name
string
The name of the resource.
This taken from the name label of the resource definition.
| |// given the following resource resource “container” “ubuntu” { … }
// the resulting name will be ubuntu
Value value
type: int
Examples
Section titled “Examples”resource "random_number" "port" { minimum = 10000 maximum = 20000}
output "random_number" { value = resource.random_number.port.value}