Difference between revisions of "Terraform resource: random string"

From wikieduonline
Jump to navigation Jump to search
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  
 +
* https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string
 
  random_string
 
  random_string
  
 +
== Examples ==
  
 +
Official example:
 +
resource "random_string" "random" {
 +
  length          = 16
 +
  special          = true
 +
  override_special = "/@£$"
 +
}
  
[[terrafrom plan]]
+
Exclude special characters:
  [[random_string.suffix]]: [[Refreshing state]]... [id=7x929348]
+
  resource "random_string" "yourrandom" {
 +
  length          = 8
 +
  special          = false
 +
}
  
 +
 +
resource "random_string" "mysuffix" {
 +
  length  = 8
 +
  special = false
 +
}
 +
 +
[[terraform plan]]
 +
[[random_string.mysuffix]]: [[Refreshing state]]... [id=7x929348]
  
 
== Related ==
 
== Related ==
 
* [[Deploy EKS cluster using Terraform]]
 
* [[Deploy EKS cluster using Terraform]]
 
* [[Random]]
 
* [[Random]]
 +
* <code>[[random_password]]</code>
  
 
== See also ==
 
== See also ==

Latest revision as of 05:35, 12 February 2024

random_string

Examples[edit]

Official example:

resource "random_string" "random" {
  length           = 16
  special          = true
  override_special = "/@£$"
}

Exclude special characters:

resource "random_string" "yourrandom" {
  length           = 8
  special          = false
}


resource "random_string" "mysuffix" {
  length  = 8
  special = false
}

terraform plan
random_string.mysuffix: Refreshing state... [id=7x929348]

Related[edit]

See also[edit]

Advertising: