Skip to content

Instantly share code, notes, and snippets.

@seansummers
Created May 9, 2024 01:24
Show Gist options
  • Save seansummers/6ac578f18a82066aa4b4e1bdc048c61e to your computer and use it in GitHub Desktop.
Save seansummers/6ac578f18a82066aa4b4e1bdc048c61e to your computer and use it in GitHub Desktop.
Stupid TF Tricks
# how do we get credentials in here? Who knows....
data "external" "stack" {
program = [ "xargs", "-0",
"aws", "cloudformation", "describe-stack-resource", "--output", "json",
"--query", "StackResourceDetail.{id:PhysicalResourceId}" ]
query = {
StackName: "StackName",
LogicalResourceId: "LogicalResourceName",
}
}
output "physical_stack_resource":
value = data.external.stack.result.id
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment