From 6bfd1133c7c98f32921211433389c1d8a7c71fcd Mon Sep 17 00:00:00 2001 From: gregory hendrickson Date: Wed, 15 Nov 2023 14:19:51 -0800 Subject: [PATCH] ``` for code block --- terraform.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/terraform.md b/terraform.md index 04523bb..6dc6a59 100644 --- a/terraform.md +++ b/terraform.md @@ -436,20 +436,24 @@ Alternatives to Provisioners: * environment (optional) * A map of environment variables to set prior to execution. This is useful for passing secret values to scripts. +``` resource "aws_instance" "web" { # ... provisioner "local-exec" { command = "echo ${aws_instance.web.private_ip} >> private_ips.txt" } } +``` +``` resource "null_resource" "example2" { provisioner "local-exec" { command = "Get-Date > completed.txt" interpreter = ["PowerShell", "-Command"] } } - +``` +``` resource "aws_instance" "web" { # ... provisioner "local-exec" { @@ -461,6 +465,7 @@ Alternatives to Provisioners: } } } +``` ## Remote-Exec * Remote-Exec allows you to execute commands on a target resource after a resource is provisioned