1010endif
1111
1212ECR_URI =$(TF_VAR_allowed_account_id ) .dkr.ecr.us-west-2.amazonaws.com
13+ REPLICATED_ECR_URI =$(TF_VAR_allowed_account_id ) .dkr.ecr.$(TF_VAR_region ) .amazonaws.com
1314IMAGE_TAG_BASE =$(ECR_URI ) /$(TF_VAR_app ) -ecr:$(TF_WORKSPACE )
15+ REPLICATED_IMAGE_TAG_BASE =$(REPLICATED_ECR_URI ) /$(TF_VAR_app ) -ecr:$(TF_WORKSPACE )
1416
1517# This is a hack to eval the image tag only when it's a dependency, cause we don't want to set it until docker builds
1618get_image_tag = IMAGE_TAG = $$(IMAGE_TAG_BASE ) -$$(shell docker inspect --format $$(format-filter ) $$(IMAGE_TAG_BASE ) -latest | sed -e 's/sha256://g')
19+ get_replicated_image_tag = REPLICATED_IMAGE_TAG = $$(REPLICATED_IMAGE_TAG_BASE ) -$$(shell docker inspect --format $$(format-filter ) $$(IMAGE_TAG_BASE ) -latest | sed -e 's/sha256://g')
1720
1821.PHONY : eval_image_tag
1922
2023eval_image_tag :
2124 $(eval $(get_image_tag ) )
25+ $(eval $(get_replicated_image_tag ) )
2226
2327# GET the absolute location for .env.production.local, again, only after it exists
2428
@@ -60,7 +64,7 @@ docker-push: docker-tag eval_image_tag
6064.PHONY : clean-terraform
6165
6266clean-terraform : eval_image_tag
63- tofu -chdir=app destroy -var=" image_tag=$( IMAGE_TAG ) "
67+ tofu -chdir=app destroy -var=" image_tag=$( REPLICATED_IMAGE_TAG ) "
6468
6569.PHONY : clean-shared
6670
@@ -120,7 +124,7 @@ plan-shared: shared/.terraform
120124.PHONY : plan-app
121125
122126plan-app : app/.terraform .tfworkspace eval_image_tag eval_env_file eval_ingest_env_file
123- tofu -chdir=app plan -var=" image_tag=$( IMAGE_TAG ) " -var=' env_files=["$(ENV_FILE)"]' -var=' ingest_env_files=["$(INGEST_ENV_FILE)"]'
127+ tofu -chdir=app plan -var=" image_tag=$( REPLICATED_IMAGE_TAG ) " -var=' env_files=["$(ENV_FILE)"]' -var=' ingest_env_files=["$(INGEST_ENV_FILE)"]'
124128
125129.PHONY : plan
126130
@@ -139,7 +143,7 @@ apply-shared: shared/.terraform
139143.PHONY : apply-app
140144
141145apply-app : app/.terraform .tfworkspace docker-push eval_image_tag eval_env_file eval_ingest_env_file
142- tofu -chdir=app apply -var=" image_tag=$( IMAGE_TAG ) " -var=' env_files=["$(ENV_FILE)"]' -var=' ingest_env_files=["$(INGEST_ENV_FILE)"]' $(APPLY_ARGS )
146+ tofu -chdir=app apply -var=" image_tag=$( REPLICATED_IMAGE_TAG ) " -var=' env_files=["$(ENV_FILE)"]' -var=' ingest_env_files=["$(INGEST_ENV_FILE)"]' $(APPLY_ARGS )
143147
144148.PHONY : apply
145149apply : apply-shared apply-app
@@ -150,7 +154,7 @@ console-shared: shared/.terraform
150154
151155.PHONY : console
152156console : app/.terraform .tfworkspace eval_image_tag eval_env_file eval_ingest_env_file
153- tofu -chdir=app console -var=" image_tag=$( IMAGE_TAG ) " -var=' env_files=["$(ENV_FILE)"]' -var=' ingest_env_files=["$(INGEST_ENV_FILE)"]'
157+ tofu -chdir=app console -var=" image_tag=$( REPLICATED_IMAGE_TAG ) " -var=' env_files=["$(ENV_FILE)"]' -var=' ingest_env_files=["$(INGEST_ENV_FILE)"]'
154158
155159.PHONY : wait-deploy
156160wait-deploy :
0 commit comments