Skip to content

Instantly share code, notes, and snippets.

@artburkart
Created March 12, 2017 22:45
Show Gist options
  • Save artburkart/d5dd81302179493b2ab2c23fbfcb84b8 to your computer and use it in GitHub Desktop.
Save artburkart/d5dd81302179493b2ab2c23fbfcb84b8 to your computer and use it in GitHub Desktop.
Test case for aws_route_table data source
provider "aws" {
region = "us-east-1"
}
data "aws_route_table" "art" {
subnet_id = "subnet-########"
}
data "template_file" "art" {
template = "$${rtb_route}"
vars {
rtb_route = "${data.aws_route_table.art.routes.0.cidr_block}"
}
}
resource "null_resource" "art" {
triggers {
template = "${data.template_file.art.rendered}"
}
provisioner "local-exec" {
command = "echo \"${data.template_file.art.rendered}\" > art.txt"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment