Skip to content

Instantly share code, notes, and snippets.

@nbcchen
Created October 24, 2024 02:01
Show Gist options
  • Save nbcchen/d4e54c33a3c358a2d3fd15581abd067f to your computer and use it in GitHub Desktop.
Save nbcchen/d4e54c33a3c358a2d3fd15581abd067f to your computer and use it in GitHub Desktop.
Construct ECR image
data "aws_ecr_repository" "repo" {
name = var.repository_name
}
locals {
image = "${data.aws_ecr_repository.repo.repository_url}:${var.image_tag}"
}
# hashicorp/aws >= 5.39.1
data "aws_ecr_image" "this" {
repository_name = var.repository_name
image_tag = var.image_tag
}
locals {
image = data.aws_ecr_image.this.image_uri
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment