Last active
March 12, 2017 22:44
-
-
Save artburkart/16f88b5856861d164dae4b1aeefc0724 to your computer and use it in GitHub Desktop.
Test case for aws_instances data source
This file contains 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
provider "aws" { | |
region = "us-east-1" | |
} | |
data "aws_instances" "boxes" { | |
instance_ids = ["i-########", "i-########"] | |
} | |
data "template_file" "boxes" { | |
template = "$${instance_subnet}" | |
vars { | |
instance_subnet = "${data.aws_instances.boxes.instances.0.subnet_id}" | |
} | |
} | |
resource "null_resource" "boxes" { | |
triggers { | |
template = "${data.template_file.boxes.rendered}" | |
} | |
provisioner "local-exec" { | |
command = "echo \"${data.template_file.boxes.rendered}\" > instances.txt" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment