|
| 1 | +### |
| 2 | +### ECRs for the various Alma integrations |
| 3 | +### |
| 4 | + |
| 5 | +################################################################################ |
| 6 | +## patronload |
| 7 | +module "ecr_patronload" { |
| 8 | + source = "./modules/ecr" |
| 9 | + repo_name = "alma-patronload" |
| 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 = "alma-patronload" |
| 16 | + } |
| 17 | +} |
| 18 | + |
| 19 | +# Outputs in dev |
| 20 | +output "patronload_dev_build_workflow" { |
| 21 | + value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/dev-build.tpl", { |
| 22 | + region = var.aws_region |
| 23 | + role = module.ecr_patronload.gha_role |
| 24 | + ecr = module.ecr_patronload.repository_name |
| 25 | + function = "" |
| 26 | + } |
| 27 | + ) |
| 28 | + description = "Full contents of the dev-build.yml for the alma-patronload repo" |
| 29 | +} |
| 30 | +output "patronload_makefile" { |
| 31 | + value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile.tpl", { |
| 32 | + ecr_name = module.ecr_patronload.repository_name |
| 33 | + ecr_url = module.ecr_patronload.repository_url |
| 34 | + function = "" |
| 35 | + } |
| 36 | + ) |
| 37 | + description = "Full contents of the Makefile for the alma-patronload repo (allows devs to push to Dev account only)" |
| 38 | +} |
| 39 | + |
| 40 | +# Outputs in stage |
| 41 | +output "patronload_stage_build_workflow" { |
| 42 | + value = var.environment == "prod" || var.environment == "dev" ? null : templatefile("${path.module}/files/stage-build.tpl", { |
| 43 | + region = var.aws_region |
| 44 | + role = module.ecr_patronload.gha_role |
| 45 | + ecr = module.ecr_patronload.repository_name |
| 46 | + function = "" |
| 47 | + } |
| 48 | + ) |
| 49 | + description = "Full contents of the stage-build.yml for the alma-patronload repo" |
| 50 | +} |
| 51 | + |
| 52 | +# Outputs after promotion to prod |
| 53 | +output "patronload_prod_promote_workflow" { |
| 54 | + value = var.environment == "stage" || var.environment == "dev" ? null : templatefile("${path.module}/files/prod-promote.tpl", { |
| 55 | + region = var.aws_region |
| 56 | + role_stage = "${module.ecr_patronload.repo_name}-gha-stage" |
| 57 | + role_prod = "${module.ecr_patronload.repo_name}-gha-prod" |
| 58 | + ecr_stage = "${module.ecr_patronload.repo_name}-stage" |
| 59 | + ecr_prod = "${module.ecr_patronload.repo_name}-prod" |
| 60 | + function = "" |
| 61 | + } |
| 62 | + ) |
| 63 | + description = "Full contents of the prod-promote.yml for the alma-patronload repo" |
| 64 | +} |
| 65 | + |
| 66 | +################################################################################ |
| 67 | +## creditcardslips |
| 68 | +module "ecr_creditcardslips" { |
| 69 | + source = "./modules/ecr" |
| 70 | + repo_name = "alma-creditcardslips" |
| 71 | + login_policy_arn = aws_iam_policy.login.arn |
| 72 | + oidc_arn = data.aws_ssm_parameter.oidc_arn.value |
| 73 | + environment = var.environment |
| 74 | + tfoutput_ssm_path = var.tfoutput_ssm_path |
| 75 | + tags = { |
| 76 | + app-repo = "alma-creditcardslips" |
| 77 | + } |
| 78 | +} |
| 79 | + |
| 80 | +# Outputs in dev |
| 81 | +output "creditcardslips_dev_build_workflow" { |
| 82 | + value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/dev-build.tpl", { |
| 83 | + region = var.aws_region |
| 84 | + role = module.ecr_creditcardslips.gha_role |
| 85 | + ecr = module.ecr_creditcardslips.repository_name |
| 86 | + function = "" |
| 87 | + } |
| 88 | + ) |
| 89 | + description = "Full contents of the dev-build.yml for the alma-creditcardslips repo" |
| 90 | +} |
| 91 | +output "creditcardslips_makefile" { |
| 92 | + value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile.tpl", { |
| 93 | + ecr_name = module.ecr_creditcardslips.repository_name |
| 94 | + ecr_url = module.ecr_creditcardslips.repository_url |
| 95 | + function = "" |
| 96 | + } |
| 97 | + ) |
| 98 | + description = "Full contents of the Makefile for the alma-creditcardslips repo (allows devs to push to Dev account only)" |
| 99 | +} |
| 100 | + |
| 101 | +# Outputs in stage |
| 102 | +output "creditcardslips_stage_build_workflow" { |
| 103 | + value = var.environment == "prod" || var.environment == "dev" ? null : templatefile("${path.module}/files/stage-build.tpl", { |
| 104 | + region = var.aws_region |
| 105 | + role = module.ecr_creditcardslips.gha_role |
| 106 | + ecr = module.ecr_creditcardslips.repository_name |
| 107 | + function = "" |
| 108 | + } |
| 109 | + ) |
| 110 | + description = "Full contents of the stage-build.yml for the alma-creditcardslips repo" |
| 111 | +} |
| 112 | + |
| 113 | +# Outputs after promotion to prod |
| 114 | +output "creditcardslips_prod_promote_workflow" { |
| 115 | + value = var.environment == "stage" || var.environment == "dev" ? null : templatefile("${path.module}/files/prod-promote.tpl", { |
| 116 | + region = var.aws_region |
| 117 | + role_stage = "${module.ecr_creditcardslips.repo_name}-gha-stage" |
| 118 | + role_prod = "${module.ecr_creditcardslips.repo_name}-gha-prod" |
| 119 | + ecr_stage = "${module.ecr_creditcardslips.repo_name}-stage" |
| 120 | + ecr_prod = "${module.ecr_creditcardslips.repo_name}-prod" |
| 121 | + function = "" |
| 122 | + } |
| 123 | + ) |
| 124 | + description = "Full contents of the prod-promote.yml for the alma-creditcardslips repo" |
| 125 | +} |
| 126 | + |
| 127 | + |
| 128 | +################################################################################ |
| 129 | +## sapinvoices |
| 130 | +module "ecr_sapinvoices" { |
| 131 | + source = "./modules/ecr" |
| 132 | + repo_name = "alma-sapinvoices" |
| 133 | + login_policy_arn = aws_iam_policy.login.arn |
| 134 | + oidc_arn = data.aws_ssm_parameter.oidc_arn.value |
| 135 | + environment = var.environment |
| 136 | + tfoutput_ssm_path = var.tfoutput_ssm_path |
| 137 | + tags = { |
| 138 | + app-repo = "alma-sapinvoices" |
| 139 | + } |
| 140 | +} |
| 141 | + |
| 142 | +# Outputs in dev |
| 143 | +output "sapinvoices_dev_build_workflow" { |
| 144 | + value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/dev-build.tpl", { |
| 145 | + region = var.aws_region |
| 146 | + role = module.ecr_sapinvoices.gha_role |
| 147 | + ecr = module.ecr_sapinvoices.repository_name |
| 148 | + function = "" |
| 149 | + } |
| 150 | + ) |
| 151 | + description = "Full contents of the dev-build.yml for the alma-sapinvoices repo" |
| 152 | +} |
| 153 | +output "sapinvoices_makefile" { |
| 154 | + value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile.tpl", { |
| 155 | + ecr_name = module.ecr_sapinvoices.repository_name |
| 156 | + ecr_url = module.ecr_sapinvoices.repository_url |
| 157 | + function = "" |
| 158 | + } |
| 159 | + ) |
| 160 | + description = "Full contents of the Makefile for the alma-sapinvoices repo (allows devs to push to Dev account only)" |
| 161 | +} |
| 162 | + |
| 163 | +# Outputs in stage |
| 164 | +output "sapinvoices_stage_build_workflow" { |
| 165 | + value = var.environment == "prod" || var.environment == "dev" ? null : templatefile("${path.module}/files/stage-build.tpl", { |
| 166 | + region = var.aws_region |
| 167 | + role = module.ecr_sapinvoices.gha_role |
| 168 | + ecr = module.ecr_sapinvoices.repository_name |
| 169 | + function = "" |
| 170 | + } |
| 171 | + ) |
| 172 | + description = "Full contents of the stage-build.yml for the alma-sapinvoices repo" |
| 173 | +} |
| 174 | + |
| 175 | +# Outputs after promotion to prod |
| 176 | +output "sapinvoices_prod_promote_workflow" { |
| 177 | + value = var.environment == "stage" || var.environment == "dev" ? null : templatefile("${path.module}/files/prod-promote.tpl", { |
| 178 | + region = var.aws_region |
| 179 | + role_stage = "${module.ecr_sapinvoices.repo_name}-gha-stage" |
| 180 | + role_prod = "${module.ecr_sapinvoices.repo_name}-gha-prod" |
| 181 | + ecr_stage = "${module.ecr_sapinvoices.repo_name}-stage" |
| 182 | + ecr_prod = "${module.ecr_sapinvoices.repo_name}-prod" |
| 183 | + function = "" |
| 184 | + } |
| 185 | + ) |
| 186 | + description = "Full contents of the prod-promote.yml for the alma-sapinvoices repo" |
| 187 | +} |
0 commit comments