Created
June 16, 2017 08:44
-
-
Save grahamlyons/3c3ba4fe4cbee3f50ecf6b74cc4c427c to your computer and use it in GitHub Desktop.
Terraform Provisioner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "random_id" "id" { | |
byte_length = 8 | |
provisioner "local-exec" { | |
command = "./provision.sh ${self.id}" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -euo pipefail | |
echo "provisioning ${1}" > output.txt | |
for i in 1 2 3 4 5 | |
do | |
echo ${i} >> output.txt | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run with: