page_title | subcategory | description |
---|---|---|
random_string Resource - terraform-provider-random |
The resource random_string generates a random permutation of alphanumeric characters and optionally special characters.
This resource does use a cryptographic random number generator.
Historically this resource's intended usage has been ambiguous as the original example used it in a password. For backwards compatibility it will continue to exist. For unique ids please use random_id id.html, for sensitive random values please use random_password password.html. |
The resource random_string
generates a random permutation of alphanumeric characters and optionally special characters.
This resource does use a cryptographic random number generator.
Historically this resource's intended usage has been ambiguous as the original example used it in a password. For backwards compatibility it will continue to exist. For unique ids please use random_id, for sensitive random values please use random_password.
resource "random_string" "random" {
length = 16
special = true
override_special = "/@£$"
}
length
(Number) 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
).
keepers
(Map of String) Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.lower
(Boolean) Include lowercase alphabet characters in the result. Default value istrue
.min_lower
(Number) Minimum number of lowercase alphabet characters in the result. Default value is0
.min_numeric
(Number) Minimum number of numeric characters in the result. Default value is0
.min_special
(Number) Minimum number of special characters in the result. Default value is0
.min_upper
(Number) Minimum number of uppercase alphabet characters in the result. Default value is0
.number
(Boolean, Deprecated) Include numeric characters in the result. Default value istrue
. NOTE: This is deprecated, usenumeric
instead.numeric
(Boolean) Include numeric characters in the result. Default value istrue
.override_special
(String) Supply your own list of special characters to use for string generation. This overrides the default character list in the special argument. Thespecial
argument must still be set to true for any overwritten characters to be used in generation.special
(Boolean) Include special characters in the result. These are!@#$%&*()-_=+[]{}<>:?
. Default value istrue
.upper
(Boolean) Include uppercase alphabet characters in the result. Default value istrue
.
id
(String) The generated random string.result
(String) The generated random string.
Import is supported using the following syntax:
# Strings can be imported by just specifying the value of the string:
terraform import random_string.test test