Skip to content

Instantly share code, notes, and snippets.

@endofcake
Created May 30, 2018 03:05
Show Gist options
  • Save endofcake/235e1e987d95e69d3245c88eafa4c594 to your computer and use it in GitHub Desktop.
Save endofcake/235e1e987d95e69d3245c88eafa4c594 to your computer and use it in GitHub Desktop.
External data source for Terraform that provides tags for all images in an ECS task definition
# Use current image versions to avoid surreptitious app deployments
data "external" "active_image_versions" {
program = ["python", "/scripts/get_image_tags.py"]
query = {
cluster_name = "${data.terraform_remote_state.ecs.ecs_cluster_id}"
service_name = "${var.app_name}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment