|
| 1 | +############################################################################## |
| 2 | +# s3-bagit-validator for the CDPS project in the us-west-2 region |
| 3 | +# We use the same locals block as the _default |
| 4 | + |
| 5 | +module "ecr_cdps_s3_bagit_validator_west" { |
| 6 | + source = "./modules/ecr" |
| 7 | + providers = { |
| 8 | + aws = aws.west-2 |
| 9 | + } |
| 10 | + repo_name = "s3-bagit-validator" |
| 11 | + login_policy_arn = aws_iam_policy.login.arn |
| 12 | + oidc_arn = data.aws_ssm_parameter.oidc_arn.value |
| 13 | + environment = var.environment |
| 14 | + tfoutput_ssm_path = var.tfoutput_ssm_path |
| 15 | + tags = { |
| 16 | + app-repo = "s3-bagit-validator" |
| 17 | + } |
| 18 | +} |
| 19 | + |
| 20 | +## For s3-bagit-validator application repo and ECR repository in us-west-2 |
| 21 | +# Outputs in dev |
| 22 | +output "s3_bagit_validator_dev_build_workflow_west" { |
| 23 | + value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/dev-build-extra-region.tpl", { |
| 24 | + region = "us-west-2" |
| 25 | + role = module.ecr_cdps_s3_bagit_validator.gha_role |
| 26 | + ecr = module.ecr_cdps_s3_bagit_validator_west.repository_name |
| 27 | + function = local.ecr_cdps_s3_bagit_validator_function_name |
| 28 | + } |
| 29 | + ) |
| 30 | + description = "Additional job for the dev-build.yml for the s3-bagit-validator repo to deploy in us-west-2" |
| 31 | +} |
| 32 | + |
| 33 | +output "s3_bagit_validator_makefile_west" { |
| 34 | + value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile-extra-region.tpl", { |
| 35 | + region = "us-west-2" |
| 36 | + ecr_name = module.ecr_cdps_s3_bagit_validator_west.repository_name |
| 37 | + ecr_url = module.ecr_cdps_s3_bagit_validator_west.repository_url |
| 38 | + function = local.ecr_cdps_s3_bagit_validator_function_name |
| 39 | + } |
| 40 | + ) |
| 41 | + description = "Full contents of the Makefile for the s3-bagit-validator repo (allows devs to push to Dev account only)" |
| 42 | +} |
| 43 | + |
| 44 | +# Outputs in stage |
| 45 | +output "s3_bagit_validator_stage_build_workflow_west" { |
| 46 | + value = var.environment == "prod" || var.environment == "dev" ? null : templatefile("${path.module}/files/stage-build.tpl", { |
| 47 | + region = "us-west-2" |
| 48 | + role = module.ecr_cdps_s3_bagit_validator.gha_role |
| 49 | + ecr = module.ecr_cdps_s3_bagit_validator_west.repository_name |
| 50 | + function = local.ecr_cdps_s3_bagit_validator_function_name |
| 51 | + } |
| 52 | + ) |
| 53 | + description = "Additional job for the stage-build.yml for the s3-bagit-validator repo to deploy in us-west-2" |
| 54 | +} |
| 55 | + |
| 56 | +# Outputs after promotion to prod |
| 57 | +output "s3_bagit_validator_prod_promote_workflow_west" { |
| 58 | + value = var.environment == "stage" || var.environment == "dev" ? null : templatefile("${path.module}/files/prod-promote.tpl", { |
| 59 | + region = "us-west-2" |
| 60 | + role_stage = "${module.ecr_cdps_s3_bagit_validator_west.repo_name}-gha-stage" |
| 61 | + role_prod = "${module.ecr_cdps_s3_bagit_validator_west.repo_name}-gha-prod" |
| 62 | + ecr_stage = "${module.ecr_cdps_s3_bagit_validator_west.repo_name}-stage" |
| 63 | + ecr_prod = "${module.ecr_cdps_s3_bagit_validator_west.repo_name}-prod" |
| 64 | + function = local.ecr_cdps_s3_bagit_validator_function_name |
| 65 | + } |
| 66 | + ) |
| 67 | + description = "Additional job for the prod-promote.yml for the s3-bagit-validator repo to deploy in us-west-2" |
| 68 | +} |
0 commit comments