Difference between revisions of "Self."

From wikieduonline
Jump to navigation Jump to search
 
(7 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
  [[self.private_ip]]
 
  [[self.private_ip]]
  
 +
[[self.address]]
 +
[[self.port]]
 +
[[self.username]]
 +
[[self.password]]
 +
 +
{{local-exec mysql ex}}
  
 
== Related ==
 
== Related ==
 
  {{provisioner example}}
 
  {{provisioner example}}
  
 +
 +
resource "aws_instance" "web" {
 +
  # ...
 +
 +
  provisioner "local-exec" {
 +
    command    = "echo The server's IP address is ${self.private_ip}"
 +
    [[on_failure]] = continue
 +
  }
 +
}
  
 
== See also ==
 
== See also ==
 +
 
* {{Terraform provisioners}}
 
* {{Terraform provisioners}}
 +
 +
[[Category:Terraform]]

Latest revision as of 08:46, 31 March 2023

self.ipv4_address
self.private_ip
self.address
self.port
self.username
self.password
  provisioner "local-exec" {
   command = "mysql --host=${self.address} --port=${self.port} --user=${self.username} --password=${self.password} < ./schema.sql"
   }
 }

Related[edit]

 resource "aws_instance" "your_web" {
  # ...

  provisioner "local-exec" {
    command = "echo The server's IP address is ${self.private_ip}"
  }
}


resource "aws_instance" "web" {
  # ...

  provisioner "local-exec" {
    command    = "echo The server's IP address is ${self.private_ip}"
    on_failure = continue
  }
}

See also[edit]

Advertising: