Skip to content

Commit

Permalink
Fix ECR tag detection (#1786)
Browse files Browse the repository at this point in the history
* remove tags_all and tags from aws_ecr_repository

* add provider with default tags

* add provider definition with default tags for ECR repositories
  • Loading branch information
markdboyd authored Sep 26, 2024
1 parent d9de23d commit dec3c8c
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 55 deletions.
63 changes: 9 additions & 54 deletions terraform/stacks/ecr/stack.tf
Original file line number Diff line number Diff line change
@@ -1,60 +1,17 @@
variable "remote_state_bucket" {
}

variable "tooling_stack_name" {
}

variable "repositories" {
type = set(string)
default = [
"bosh-deployment-resource",
"bosh-io-release-resource",
"bosh-io-stemcell-resource",
"cf-cli-resource",
"cf-resource",
"cloud-service-broker",
"concourse-http-jq-resource",
"concourse-task",
"cron-resource",
"csb",
"email-resource",
"external-domain-broker-testing",
"external-domain-broker-migrator-testing",
"general-task",
"git-resource",
"github-pr-resource",
"github-release-resource",
"legacy-domain-certificate-renewer-testing",
"oci-build-task",
"openresty",
"pages-dind",
"pages-dind-v25",
"pages-nginx-v1",
"pages-node-v20",
"pages-postgres-v15",
"pages-python-v3.11",
"pages-redis-v7.2",
"pages-zap",
"playwright-python",
"pool-resource",
"pulledpork",
"registry-image-resource",
"s3-resource",
"s3-simple-resource",
"semver-resource",
"slack-notification-resource",
"opensearch-testing",
"opensearch-dashboards-testing",
"time-resource",
"ubuntu-hardened",
]
}

terraform {
backend "s3" {
}
}

provider "aws" {
use_fips_endpoint = true

default_tags {
tags = {
deployment = "ecr"
}
}
}

data "terraform_remote_state" "tooling" {
backend = "s3"
Expand All @@ -70,8 +27,6 @@ resource "aws_ecr_repository" "repository" {

name = each.key
image_tag_mutability = "MUTABLE"
tags = {}
tags_all = {}
}

resource "aws_ecr_lifecycle_policy" "ecr_repository_lifecycle_policy" {
Expand Down
51 changes: 51 additions & 0 deletions terraform/stacks/ecr/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
variable "remote_state_bucket" {
}

variable "tooling_stack_name" {
}

variable "repositories" {
type = set(string)
default = [
"bosh-deployment-resource",
"bosh-io-release-resource",
"bosh-io-stemcell-resource",
"cf-cli-resource",
"cf-resource",
"cloud-service-broker",
"concourse-http-jq-resource",
"concourse-task",
"cron-resource",
"csb",
"email-resource",
"external-domain-broker-testing",
"external-domain-broker-migrator-testing",
"general-task",
"git-resource",
"github-pr-resource",
"github-release-resource",
"legacy-domain-certificate-renewer-testing",
"oci-build-task",
"openresty",
"pages-dind",
"pages-dind-v25",
"pages-nginx-v1",
"pages-node-v20",
"pages-postgres-v15",
"pages-python-v3.11",
"pages-redis-v7.2",
"pages-zap",
"playwright-python",
"pool-resource",
"pulledpork",
"registry-image-resource",
"s3-resource",
"s3-simple-resource",
"semver-resource",
"slack-notification-resource",
"opensearch-testing",
"opensearch-dashboards-testing",
"time-resource",
"ubuntu-hardened",
]
}
2 changes: 1 addition & 1 deletion terraform/stacks/tooling/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ variable "rds_apply_immediately" {
}

variable "rds_db_engine_version" {
default = "12.17"
default = "12.19"
}

variable "rds_parameter_group_family" {
Expand Down

0 comments on commit dec3c8c

Please sign in to comment.