Skip to content

Commit

Permalink
Add random resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Veld committed May 11, 2023
1 parent 7e095c9 commit e48cfa5
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/config/navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ export const navigation = [
{ title: 'Network', href: '/docs/resources/network' },
{ title: 'Output', href: '/docs/resources/output' },
{ title: 'Remote Exec', href: '/docs/resources/remote_exec' },
{ title: 'Random', href: '/docs/resources/random' },
{ title: 'Random Number', href: '/docs/resources/random_number' },
{ title: 'Random ID', href: '/docs/resources/random_id' },
{ title: 'Random UUID', href: '/docs/resources/random_uuid' },
{ title: 'Random Password', href: '/docs/resources/random_password' },
{ title: 'Random Creature', href: '/docs/resources/random_creature' },
{ title: 'Sidecar', href: '/docs/resources/sidecar' },
{ title: 'Template', href: '/docs/resources/template' },
{ title: 'Variables', href: '/docs/resources/variables' },
Expand Down
27 changes: 27 additions & 0 deletions src/pages/docs/resources/random_creature.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import MetaProperties from "./shared/meta.mdx"

# Random creature `random_creature`

<Intro>
The `random_creature` resource allow the creation of random creatures.
</Intro>

## Properties

<Properties>
<Property name="value" type="string" value="" readonly>
The generated random creature.
</Property>
</Properties>

<MetaProperties/>

## Examples

```hcl
resource "random_creature" "creature" {}
output "creature" {
value = resource.random_creature.creature.value
}
```
37 changes: 37 additions & 0 deletions src/pages/docs/resources/random_id.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import MetaProperties from "./shared/meta.mdx"

# Random ID `random_id`

<Intro>
The `random_id` resource allows the creation of random IDs.
</Intro>

## Properties

<Properties>
<Property name="byte_length" type="int" required="true" value="0">
The number of bytes to use when generating the random ID.
</Property>

<Property name="value" type="int" value="" readonly>
The generated random ID.
</Property>
</Properties>

<MetaProperties/>

## Examples

```hcl
resource "random_id" "id" {
byte_length = 4
}
output "id_hex" {
value = resource.random_id.id.hex
}
output "id_dec" {
value = resource.random_id.id.dec
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import MetaProperties from "./shared/meta.mdx"
# Random Number `random_number`

<Intro>
The `random_number` resource allow the creation of random numbers.
The `random_number` resource allows the creation of random numbers.
</Intro>

## Properties
Expand Down Expand Up @@ -35,4 +35,4 @@ resource "random_number" "port" {
output "random_number" {
value = resource.random_number.port.value
}
```
```
58 changes: 58 additions & 0 deletions src/pages/docs/resources/random_password.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import MetaProperties from "./shared/meta.mdx"

# Random Password `random_password`

<Intro>
The `random_password` resource allows the creation of random passwords.
</Intro>

## Properties

<Properties>
<Property name="length" type="int" required="true" value="0">
The length of the generated value.
</Property>
<Property name="special" type="bool" required="false" value="true">
Wether or not to include special characters in the generated password.
</Property>
<Property name="numeric" type="bool" required="false" value="true">
Wether or not to include numeric characters in the generated password.
</Property>
<Property name="upper" type="bool" required="false" value="true">
Wether or not to include uppercase characters in the generated password.
</Property>
<Property name="lower" type="bool" required="false" value="true">
Wether or not to include lowercase characters in the generated password.
</Property>

<Property name="min_special" type="int" required="false" value="0">
The minimum number of special characters to include in the generated password.
</Property>
<Property name="min_numeric" type="int" required="false" value="0">
The minimum number of numeric characters to include in the generated password.
</Property>
<Property name="min_upper" type="int" required="false" value="0">
The minimum number of uppercase characters to include in the generated password.
</Property>
<Property name="min_lower" type="int" required="false" value="0">
The minimum number of lowercase characters to include in the generated password.
</Property>

<Property name="value" type="int" value="" readonly>
The generated password.
</Property>
</Properties>

<MetaProperties/>

## Examples

```hcl
resource "random_password" "password" {
length = 32
}
output "password" {
value = resource.random_password.password.value
}
```
27 changes: 27 additions & 0 deletions src/pages/docs/resources/random_uuid.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import MetaProperties from "./shared/meta.mdx"

# Random UUID `random_uuid`

<Intro>
The `random_uuid` resource allows the creation of random UUIDs.
</Intro>

## Properties

<Properties>
<Property name="value" type="string" value="" readonly>
The generated random UUID.
</Property>
</Properties>

<MetaProperties/>

## Examples

```hcl
resource "random_uuid" "uuid" {}
output "uuid" {
value = resource.random_uuid.uuid.value
}
```

0 comments on commit e48cfa5

Please sign in to comment.