Skip to content

Instantly share code, notes, and snippets.

@podhmo
Created Mar 31, 2021
Embed
What would you like to do?
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