Skip to content

Commit acbfead

Browse files
committed
(Fix) Append workspace to ECR name
* Was unable to run terraform apply because the ECR already existed * Wil now use a different ECR per workspace
1 parent 78faf8e commit acbfead

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

terraform/terraform.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ terraform {
2020
## ECR
2121

2222
resource "aws_ecr_repository" "api" {
23-
name = "${var.app_name}"
23+
name = "${var.app_name}-${terraform.workspace}"
2424
}
2525

2626
## CodePipeline
@@ -78,7 +78,7 @@ data "template_file" "buildspec" {
7878

7979
vars {
8080
aws_account_id = "${data.aws_caller_identity.current.account_id}"
81-
image_repo_name = "${var.app_name}"
81+
image_repo_name = "${var.app_name}-${terraform.workspace}"
8282
rails_env = "${var.rails_env}"
8383
task_name = "dss-infrastructure-${terraform.workspace}-api"
8484
}

0 commit comments

Comments
 (0)