Skip to content

Instantly share code, notes, and snippets.

@podhmo
Created March 31, 2021 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save podhmo/d2d828e76e6f0b43dfdf45c2bb793c89 to your computer and use it in GitHub Desktop.
Save podhmo/d2d828e76e6f0b43dfdf45c2bb793c89 to your computer and use it in GitHub Desktop.
00
terraform apply -auto-approve
null_resource.echo: Creating...
null_resource.echo: Provisioning with 'local-exec'...
null_resource.echo (local-exec): Executing: ["/bin/sh" "-c" "echo x=10 y=20 z=30\n"]
null_resource.echo (local-exec): x=10 y=20 z=30
null_resource.echo: Creation complete after 0s [id=2240813459510242007]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
terraform show
# null_resource.echo:
resource "null_resource" "echo" {
id = "2240813459510242007"
triggers = {
"x" = "10"
"y" = "20"
"z" = "30"
}
}
locals {
x = 10
y = 20
z = 30
}
resource "null_resource" "echo" {
triggers = {
x = local.x
y = local.y
z = local.z
}
provisioner "local-exec" {
command = <<EOS
echo x=${local.x} y=${local.y} z=${local.z}
EOS
}
}
00:
terraform apply -auto-approve
terraform show
01:
terraform output
fmt:
terraform fmt
init:
terraform init
.PHONY: init fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment