Created
September 21, 2023 14:07
-
-
Save ehaselwanter/dbac037f6f6f279c2306678eb0c6fae5 to your computer and use it in GitHub Desktop.
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
| variable "revision" { | |
| default = 1 | |
| } | |
| resource "terraform_data" "trigger-update" { | |
| input = var.revision | |
| } | |
| resource "terraform_data" "exec-container" { | |
| triggers_replace = [ | |
| terraform_data.trigger-update | |
| ] | |
| connection { | |
| type = "ssh" | |
| user = "ubuntu" | |
| private_key = tls_private_key.ssh_key.private_key_pem | |
| host = aws_instance.web.public_ip | |
| } | |
| provisioner "remote-exec" { | |
| inline = [ | |
| "echo revision:${var.revision} > terraform_data.txt", | |
| ] | |
| } | |
| } | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sample output: