add modules 5-9

This commit is contained in:
sid palas
2021-05-27 14:35:03 -07:00
parent 1d095e337a
commit 4de9385fce
34 changed files with 1331 additions and 87 deletions

View File

@@ -0,0 +1,21 @@
#!/bin/bash
set -euo pipefail
# Change directory to example
cd ../../examples/hello-world
# Create the resources
terraform init
terraform apply -auto-approve
# Wait while the instance boots up
# (Could also use a provisioner in the TF config to do this)
sleep 60
# Query the output, extract the IP and make a request
terraform output -json |\
jq -r '.instance_ip_addr.value' |\
xargs -I {} curl http://{}:8080 -m 10
# If request succeeds, destroy the resources
terraform destroy -auto-approve