|
| 1 | + |
| 2 | +# hrqb_client containers |
| 3 | +# This is a standard ECR for an ECS with a Fargate launch type |
| 4 | +locals { |
| 5 | + ecr_hrqb_client = "hrqb-client-${var.environment}" |
| 6 | +} |
| 7 | +module "ecr_hrqb_client" { |
| 8 | + source = "./modules/ecr" |
| 9 | + repo_name = "hrqb-client" |
| 10 | + login_policy_arn = aws_iam_policy.login.arn |
| 11 | + oidc_arn = data.aws_ssm_parameter.oidc_arn.value |
| 12 | + environment = var.environment |
| 13 | + tfoutput_ssm_path = var.tfoutput_ssm_path |
| 14 | + tags = { |
| 15 | + app-repo = "hrqb-client" |
| 16 | + } |
| 17 | +} |
| 18 | + |
| 19 | +## Outputs to Terraform Cloud for devs ## |
| 20 | + |
| 21 | +## For hrqb_client application repo and ECR repository |
| 22 | +# Outputs in dev |
| 23 | +output "hrqb_client_fargate_dev_build_workflow" { |
| 24 | + value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/dev-build.tpl", { |
| 25 | + region = var.aws_region |
| 26 | + role = module.ecr_hrqb_client.gha_role |
| 27 | + ecr = module.ecr_hrqb_client.repository_name |
| 28 | + function = "" |
| 29 | + } |
| 30 | + ) |
| 31 | + description = "Full contents of the dev-build.yml for the hrqb-client repo" |
| 32 | +} |
| 33 | +output "hrqb_client_fargate_makefile" { |
| 34 | + value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile.tpl", { |
| 35 | + ecr_name = module.ecr_hrqb_client.repository_name |
| 36 | + ecr_url = module.ecr_hrqb_client.repository_url |
| 37 | + function = "" |
| 38 | + } |
| 39 | + ) |
| 40 | + description = "Full contents of the Makefile for the hrqb-client repo (allows devs to push to Dev account only)" |
| 41 | +} |
| 42 | + |
| 43 | +# Outputs in stage |
| 44 | +output "hrqb_client_fargate_stage_build_workflow" { |
| 45 | + value = var.environment == "prod" || var.environment == "dev" ? null : templatefile("${path.module}/files/stage-build.tpl", { |
| 46 | + region = var.aws_region |
| 47 | + role = module.ecr_hrqb_client.gha_role |
| 48 | + ecr = module.ecr_hrqb_client.repository_name |
| 49 | + function = "" |
| 50 | + } |
| 51 | + ) |
| 52 | + description = "Full contents of the stage-build.yml for the hrqb-client repo" |
| 53 | +} |
| 54 | + |
| 55 | +# Outputs after promotion to prod |
| 56 | +output "hrqb_client_fargate_prod_promote_workflow" { |
| 57 | + value = var.environment == "stage" || var.environment == "dev" ? null : templatefile("${path.module}/files/prod-promote.tpl", { |
| 58 | + region = var.aws_region |
| 59 | + role_stage = "${module.ecr_hrqb_client.repo_name}-gha-stage" |
| 60 | + role_prod = "${module.ecr_hrqb_client.repo_name}-gha-prod" |
| 61 | + ecr_stage = "${module.ecr_hrqb_client.repo_name}-stage" |
| 62 | + ecr_prod = "${module.ecr_hrqb_client.repo_name}-prod" |
| 63 | + function = "" |
| 64 | + } |
| 65 | + ) |
| 66 | + description = "Full contents of the prod-promote.yml for the hrqb-client repo" |
| 67 | +} |
0 commit comments