Commit Graph

8 Commits

Author SHA1 Message Date
Joe Topjian 0edbedd1a8 random_pet resource (#12903)
* vendor: adding golang-petname for random_pet resource

* provider/random: random_pet resource
2017-03-27 12:50:39 +03:00
Seth Vargo 5d79395354
Add a prefix option to random_id provider 2017-02-16 11:08:17 -05:00
James Nugent a0c5d42fa4 provider/random: Separate read from create
We now generate the read operation which sets the various encodings of
the random value such that adding new ones does not require generating a
new random value.

We also verify that these are set correctly via the acceptance tests.
2016-11-06 17:05:11 -06:00
James Nugent a7451bfab3 provider/random: Use schema Noop functions 2016-11-06 10:07:38 -06:00
James Nugent 314a56e503 provider/random: Add b64_std to random_id
This commit makes three related changes to the `random_id` resource:

1. Deprecate the `b64` attribute
2. Introduce a new `b64_url` attribute which functions in the same
   manner as the original `b64` attribute
3. Introduce a new `b64_std` attribute which uses standard base64
   encoding for the value rather than URL encoding.

Resource identifiers continue to use URL encoded base 64.

The reason for adding standard encoding of the base 64 value is to allow
the use of generated values as a Serf Encryption Key for separating
Consul clusters - these rely on standard encoding and do not permit some
characters which are allowed by URL encoding. `b64_url` is introduced
in order that there is consistency in specifying the desired encoding
during interpolation.
2016-11-06 09:58:24 -06:00
Martin Atkins eec6c88fd2 provider/random: random_shuffle resource
random_shuffle takes a list of strings and returns a new list with the
same items in a random permutation.

Optionally allows the result list to be a different length than the
input list. A shorter result than input results in some items being
excluded. A longer result than input results in some items being
repeated, but never more often than the number of input items.
2016-05-14 16:48:45 -07:00
Martin Atkins b1de477691 provider/random: random_id resource
This resource generates a cryptographically-strong set of bytes and
provides them as base64, hexadecimal and decimal string representations.
It is intended to be used for generating unique ids for resources
elsewhere in the configuration, and thus the "keepers" would be set to
any ForceNew attributes of the target resources, so that a new id is
generated each time a new resource is generated.
2016-05-14 15:26:42 -07:00
Martin Atkins 3e34ddbf38 New "random" provider, representing randomness
This provider will have logical resources that allow Terraform to "manage"
randomness as a resource, producing random numbers on create and then
retaining the outcome in the state so that it will remain consistent
until something explicitly triggers generating new values.

Managing randomness in this way allows configurations to do things like
random distributions and ids without causing "perma-diffs".
2016-05-14 15:26:38 -07:00