Skip to content

Commit bc5f5cf

Browse files
committed
Create alma-sapinvoices-ui ECR Repository
Why these changes are being introduced: As part of adding a web-based UI to run the SAP Invoices task, we need to set up an ECR Repository to store the container images that will be used in the Lambda function. How this addresses that need: * Create a standard ECR Repository with permissions and sample text for GHA workflows and Makefiles for a Lambda function using a container for its image Side effects of this change: None. Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/IN-1011 fix for function name
1 parent fb17f36 commit bc5f5cf

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

almaintegrations-ecrs.tf

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,71 @@ output "sapinvoices_prod_promote_workflow" {
187187
}
188188

189189

190+
################################################################################
191+
## sapinvoices-ui
192+
locals {
193+
ecr_sapinvoices_ui_function_name = "alma-sapinvoices-ui-${var.environment}"
194+
}
195+
module "ecr_sapinvoices_ui" {
196+
source = "./modules/ecr"
197+
repo_name = "alma-sapinvoices-ui"
198+
login_policy_arn = aws_iam_policy.login.arn
199+
oidc_arn = data.aws_ssm_parameter.oidc_arn.value
200+
environment = var.environment
201+
tfoutput_ssm_path = var.tfoutput_ssm_path
202+
tags = {
203+
app-repo = "alma-sapinvoices-ui"
204+
}
205+
}
206+
207+
# Outputs in dev
208+
output "sapinvoices_ui_dev_build_workflow" {
209+
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/dev-build.tpl", {
210+
region = var.aws_region
211+
role = module.ecr_sapinvoices_ui.gha_role
212+
ecr = module.ecr_sapinvoices_ui.repository_name
213+
function = local.ecr_sapinvoices_ui_function_name
214+
}
215+
)
216+
description = "Full contents of the dev-build.yml for the alma-sapinvoices-ui repo"
217+
}
218+
output "sapinvoices_ui_makefile" {
219+
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile.tpl", {
220+
ecr_name = module.ecr_sapinvoices_ui.repository_name
221+
ecr_url = module.ecr_sapinvoices_ui.repository_url
222+
function = local.ecr_sapinvoices_ui_function_name
223+
}
224+
)
225+
description = "Full contents of the Makefile for the alma-sapinvoices-ui repo (allows devs to push to Dev account only)"
226+
}
227+
228+
# Outputs in stage
229+
output "sapinvoices_ui_stage_build_workflow" {
230+
value = var.environment == "prod" || var.environment == "dev" ? null : templatefile("${path.module}/files/stage-build.tpl", {
231+
region = var.aws_region
232+
role = module.ecr_sapinvoices_ui.gha_role
233+
ecr = module.ecr_sapinvoices_ui.repository_name
234+
function = local.ecr_sapinvoices_ui_function_name
235+
}
236+
)
237+
description = "Full contents of the stage-build.yml for the alma-sapinvoices-ui repo"
238+
}
239+
240+
# Outputs after promotion to prod
241+
output "sapinvoices_ui_prod_promote_workflow" {
242+
value = var.environment == "stage" || var.environment == "dev" ? null : templatefile("${path.module}/files/prod-promote.tpl", {
243+
region = var.aws_region
244+
role_stage = "${module.ecr_sapinvoices_ui.repo_name}-gha-stage"
245+
role_prod = "${module.ecr_sapinvoices_ui.repo_name}-gha-prod"
246+
ecr_stage = "${module.ecr_sapinvoices_ui.repo_name}-stage"
247+
ecr_prod = "${module.ecr_sapinvoices_ui.repo_name}-prod"
248+
function = local.ecr_sapinvoices_ui_function_name
249+
}
250+
)
251+
description = "Full contents of the prod-promote.yml for the alma-sapinvoices-ui repo"
252+
}
253+
254+
190255
################################################################################
191256
## bursar transfer app
192257
module "ecr_bursar" {

0 commit comments

Comments
 (0)