diff --git a/ecs_api.tf b/ecs_api.tf index 05265c1..4fdb4a3 100644 --- a/ecs_api.tf +++ b/ecs_api.tf @@ -94,8 +94,9 @@ data "template_file" "api_service_container_definitions" { vars = { api_image_uri = "${aws_ecr_repository.api.repository_url}:${var.api_container_tag}" + api_image_uri = "${var.api_container_repo_url != "" ? var.api_container_repo_url : aws_ecr_repository.api.repository_url}:${var.api_container_tag}" config_var_prefix = local.config_var_prefix - migrations_image_uri = "${aws_ecr_repository.migrations.repository_url}:${var.api_container_tag}" + migrations_image_uri = "${var.migrations_container_repo_url != "" ? var.migrations_container_repo_url : aws_ecr_repository.migrations.repository_url}:${var.api_container_tag}" listening_port = var.api_listening_port logs_service_name = aws_cloudwatch_log_group.api.name log_group_region = var.aws_region diff --git a/ecs_push.tf b/ecs_push.tf index 06bd716..0c112af 100644 --- a/ecs_push.tf +++ b/ecs_push.tf @@ -81,7 +81,8 @@ data "template_file" "push_service_container_definitions" { vars = { config_var_prefix = local.config_var_prefix - image_uri = "${aws_ecr_repository.push.repository_url}:${var.push_container_tag}" + + image_uri = "${var.push_container_repo_url != "" ? var.push_container_repo_url : aws_ecr_repository.push.repository_url}:${var.push_container_tag}" listening_port = var.push_listening_port logs_service_name = aws_cloudwatch_log_group.push.name log_group_region = var.aws_region diff --git a/env-vars/deployables.tfvars b/env-vars/deployables.tfvars new file mode 100644 index 0000000..9f2bc0d --- /dev/null +++ b/env-vars/deployables.tfvars @@ -0,0 +1,22 @@ + +authorizer_lambda_s3_bucket = "" +authorizer_lambda_s3_key = "" +callback_lambda_s3_bucket = "" +callback_lambda_s3_key = "" +cso_lambda_s3_bucket = "" +cso_lambda_s3_key = "" +exposures_lambda_s3_bucket = "" +exposures_lambda_s3_key = "" +settings_lambda_s3_bucket = "" +settings_lambda_s3_key = "" +stats_lambda_s3_bucket = "" +stats_lambda_s3_key = "" +token_lambda_s3_bucket = "" +token_lambda_s3_key = "" + +push_container_repo_url = "" +api_container_repo_url = "" +migrations_container_repo_url = "" + +push_container_tag = "latest" +api_container_tag = "latest" diff --git a/variables.tf b/variables.tf index 79d924b..f4ad879 100644 --- a/variables.tf +++ b/variables.tf @@ -399,12 +399,30 @@ variable "stats_lambda_s3_bucket" { default = "" } +variable "api_container_repo_url" { + description = "ECR repo to be deployed into ECS for the API container" + type = string + default = "" +} + +variable "migrations_container_repo_url" { + description = "ECR repo to be deployed into ECS for the Migration container" + type = string + default = "" +} + variable "api_container_tag" { description = "ECR tag to be deployed into ECS for the API & Migration containers" type = string default = "latest" } +variable "push_container_repo_url" { + description = "ECR repo to be deployed into ECS for the Push API container" + type = string + default = "" +} + variable "push_container_tag" { description = "ECR tag to be deployed into ECS for the Push API container" type = string