Skip to content

Commit 1774d33

Browse files
authored
Merge pull request #37 from MITLibraries/dev
Dev-to-Stage: ECR for new Bursar Transfer Application * Create all the appropriate ECR bits for a new containerized Python application * Add checkov skips for encryption warnings about ssm_outputs
2 parents 003c054 + 837e47d commit 1774d33

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ then replace all the ssm parameter references for `oidc_arn` with `aws_iam_openi
7575
| Name | Source | Version |
7676
|------|--------|---------|
7777
| ecr\_alma\_webhook\_lambdas | ./modules/ecr | n/a |
78+
| ecr\_bursar | ./modules/ecr | n/a |
7879
| ecr\_carbon | ./modules/ecr | n/a |
7980
| ecr\_creditcardslips | ./modules/ecr | n/a |
8081
| ecr\_dss | ./modules/ecr | n/a |
@@ -122,6 +123,10 @@ then replace all the ssm parameter references for `oidc_arn` with `aws_iam_openi
122123
| alma\_webhook\_lambdas\_makefile | Full contents of the Makefile for the alma-webhook-lambdas repo (allows devs to push to Dev account only) |
123124
| alma\_webhook\_lambdas\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the alma-webhook-lambdas repo |
124125
| alma\_webhook\_lambdas\_stage\_build\_workflow | Full contents of the stage-build.yml for the alma-webhook-lambdas repo |
126+
| bursar\_dev\_build\_workflow | Full contents of the dev-build.yml for the alma-bursartransfer repo |
127+
| bursar\_makefile | Full contents of the Makefile for the alma-bursartransfer repo (allows devs to push to Dev account only) |
128+
| bursar\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the alma-bursartransfer repo |
129+
| bursar\_stage\_build\_workflow | Full contents of the stage-build.yml for the alma-bursartransfer repo |
125130
| carbon\_dev\_build\_workflow | Full contents of the dev-build.yml for the carbon repo |
126131
| carbon\_makefile | Full contents of the Makefile for the carbon repo (allows devs to push to Dev account only) |
127132
| carbon\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the carbon repo |

almaintegrations-ecrs.tf

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,65 @@ output "sapinvoices_prod_promote_workflow" {
185185
)
186186
description = "Full contents of the prod-promote.yml for the alma-sapinvoices repo"
187187
}
188+
189+
190+
################################################################################
191+
## bursar transfer app
192+
module "ecr_bursar" {
193+
source = "./modules/ecr"
194+
repo_name = "alma-bursartransfer"
195+
login_policy_arn = aws_iam_policy.login.arn
196+
oidc_arn = data.aws_ssm_parameter.oidc_arn.value
197+
environment = var.environment
198+
tfoutput_ssm_path = var.tfoutput_ssm_path
199+
tags = {
200+
app-repo = "alma-bursartransfer"
201+
}
202+
}
203+
204+
# Outputs in dev
205+
output "bursar_dev_build_workflow" {
206+
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/dev-build.tpl", {
207+
region = var.aws_region
208+
role = module.ecr_bursar.gha_role
209+
ecr = module.ecr_bursar.repository_name
210+
function = ""
211+
}
212+
)
213+
description = "Full contents of the dev-build.yml for the alma-bursartransfer repo"
214+
}
215+
output "bursar_makefile" {
216+
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile.tpl", {
217+
ecr_name = module.ecr_bursar.repository_name
218+
ecr_url = module.ecr_bursar.repository_url
219+
function = ""
220+
}
221+
)
222+
description = "Full contents of the Makefile for the alma-bursartransfer repo (allows devs to push to Dev account only)"
223+
}
224+
225+
# Outputs in stage
226+
output "bursar_stage_build_workflow" {
227+
value = var.environment == "prod" || var.environment == "dev" ? null : templatefile("${path.module}/files/stage-build.tpl", {
228+
region = var.aws_region
229+
role = module.ecr_bursar.gha_role
230+
ecr = module.ecr_bursar.repository_name
231+
function = ""
232+
}
233+
)
234+
description = "Full contents of the stage-build.yml for the alma-bursartransfer repo"
235+
}
236+
237+
# Outputs after promotion to prod
238+
output "bursar_prod_promote_workflow" {
239+
value = var.environment == "stage" || var.environment == "dev" ? null : templatefile("${path.module}/files/prod-promote.tpl", {
240+
region = var.aws_region
241+
role_stage = "${module.ecr_bursar.repo_name}-gha-stage"
242+
role_prod = "${module.ecr_bursar.repo_name}-gha-prod"
243+
ecr_stage = "${module.ecr_bursar.repo_name}-stage"
244+
ecr_prod = "${module.ecr_bursar.repo_name}-prod"
245+
function = ""
246+
}
247+
)
248+
description = "Full contents of the prod-promote.yml for the alma-bursartransfer repo"
249+
}

modules/ecr/ssm_outputs.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# ecr repository_name
44
# Type:string datatype:text format:string
55
resource "aws_ssm_parameter" "ecr_repository_name" {
6+
#checkov:skip=CKV_AWS_337:By default we are not encrypting parameters in tfoutput_ssm_path
67
#checkov:skip=CKV2_AWS_34:By default we are not encrypting parameters in tfoutput_ssm_path
78
type = "String"
89
name = "${var.tfoutput_ssm_path}/${var.repo_name}/ecr-repository-name"
@@ -16,6 +17,7 @@ resource "aws_ssm_parameter" "ecr_repository_name" {
1617
# ecr repository_url
1718
# Type:string datatype:text format:string
1819
resource "aws_ssm_parameter" "ecr_repository_url" {
20+
#checkov:skip=CKV_AWS_337:By default we are not encrypting parameters in tfoutput_ssm_path
1921
#checkov:skip=CKV2_AWS_34:By default we are not encrypting parameters in tfoutput_ssm_path
2022
type = "String"
2123
name = "${var.tfoutput_ssm_path}/${var.repo_name}/ecr-repository-url"
@@ -29,6 +31,7 @@ resource "aws_ssm_parameter" "ecr_repository_url" {
2931
# ecr role so that we can add the updatefunctioncode to it after the lambda itself is created
3032
# Type:string datatype:text format:string
3133
resource "aws_ssm_parameter" "gha_role" {
34+
#checkov:skip=CKV_AWS_337:By default we are not encrypting parameters in tfoutput_ssm_path
3235
#checkov:skip=CKV2_AWS_34:By default we are not encrypting parameters in tfoutput_ssm_path
3336
type = "String"
3437
name = "${var.tfoutput_ssm_path}/${var.repo_name}/gha-role"

0 commit comments

Comments
 (0)