Skip to content

Commit 7b073d9

Browse files
authored
Merge pull request #63 from MITLibraries/dev
Dev-to-Stage: Create ECR for TACOS Detectors
2 parents fc960c3 + a2ca227 commit 7b073d9

File tree

5 files changed

+92
-17
lines changed

5 files changed

+92
-17
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: "v1.98.0"
3+
rev: "v1.99.3"
44
hooks:
55
- id: terraform_fmt
66
args:
77
- --args=-recursive
88
- id: terraform_validate
99
- repo: https://github.com/terraform-docs/terraform-docs
10-
rev: "v0.19.0"
10+
rev: "v0.20.0"
1111
hooks:
1212
- id: terraform-docs-go
1313
args: ["markdown", "table", "--config", "./.terraform-docs.yaml", "--recursive", "--output-file", "README.md", "./"]
1414
- repo: https://github.com/bridgecrewio/checkov.git
15-
rev: '3.2.395'
15+
rev: '3.2.437'
1616
hooks:
1717
- id: checkov
1818
language_version: python3.12

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ This is a core infrastructure repository that defines infrastructure related to
116116
* [Matomo Application Container](https://github.com/MITLibraries/docker-matomo)
117117
* [PPOD](https://github.com/MITLibraries/mitlib-tf-workloads-ppod)
118118
* [PPOD Application Container](https://github.com/MITLibraries/ppod)
119+
* [TACOS](https://github.com/MITLibraries/mitlib-tf-workloads-tacos)
120+
* [tacos-detectors-lambdas](https://github.com/MITLibraries/tacos-detectors-lambdas)
119121
* [TIMDEX](https://github.com/MITLibraries/mitlib-tf-workloads-timdex-infrastructure)
120122
* [TIMDEX Application Container](https://github.com/MITLibraries/timdex)
121123
* [TIMDEX Dataset API](https://github.com/MITLibraries/timdex-dataset-api)
@@ -132,7 +134,7 @@ This is a core infrastructure repository that defines infrastructure related to
132134

133135
* Owner: See [CODEOWNERS](./.github/CODEOWNERS)
134136
* Team: See [CODEOWNERS](./.github/CODEOWNERS)
135-
* Last Maintenance: 2025-05
137+
* Last Maintenance: 2025-06
136138

137139
## TF markdown is automatically inserted at the bottom of this file, nothing should be written beyond this point
138140

@@ -172,6 +174,7 @@ This is a core infrastructure repository that defines infrastructure related to
172174
| ecr\_ppod | ./modules/ecr | n/a |
173175
| ecr\_sapinvoices | ./modules/ecr | n/a |
174176
| ecr\_sapinvoices\_ui | ./modules/ecr | n/a |
177+
| ecr\_tacos\_detectors | ./modules/ecr | n/a |
175178
| ecr\_timdex\_browsertrix | ./modules/ecr | n/a |
176179
| ecr\_timdex\_geo | ./modules/ecr | n/a |
177180
| ecr\_timdex\_lambdas | ./modules/ecr | n/a |
@@ -209,10 +212,10 @@ This is a core infrastructure repository that defines infrastructure related to
209212
| alma\_webhook\_lambdas\_makefile | Full contents of the Makefile for the alma-webhook-lambdas repo (allows devs to push to Dev account only) |
210213
| alma\_webhook\_lambdas\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the alma-webhook-lambdas repo |
211214
| alma\_webhook\_lambdas\_stage\_build\_workflow | Full contents of the stage-build.yml for the alma-webhook-lambdas repo |
212-
| apt\_fargate\_dev\_build\_workflow | Full contents of the dev-build.yml for the archival-packaging-tool repo |
213-
| apt\_fargate\_makefile | Full contents of the Makefile for the archival-packaging-tool repo (allows devs to push to Dev account only) |
214-
| apt\_fargate\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the archival-packaging-tool repo |
215-
| apt\_fargate\_stage\_build\_workflow | Full contents of the stage-build.yml for the archival-packaging-tool repo |
215+
| apt\_dev\_build\_workflow | Full contents of the dev-build.yml for the archival-packaging-tool repo |
216+
| apt\_makefile | Full contents of the Makefile for the archival-packaging-tool repo (allows devs to push to Dev account only) |
217+
| apt\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the archival-packaging-tool repo |
218+
| apt\_stage\_build\_workflow | Full contents of the stage-build.yml for the archival-packaging-tool repo |
216219
| asati\_fargate\_dev\_build\_workflow | Full contents of the dev-build.yml for the asati repo |
217220
| asati\_fargate\_makefile | Full contents of the Makefile for the asati repo (allows devs to push to Dev account only) |
218221
| asati\_fargate\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the asati repo |
@@ -285,6 +288,10 @@ This is a core infrastructure repository that defines infrastructure related to
285288
| sapinvoices\_ui\_makefile | Full contents of the Makefile for the alma-sapinvoices-ui repo (allows devs to push to Dev account only) |
286289
| sapinvoices\_ui\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the alma-sapinvoices-ui repo |
287290
| sapinvoices\_ui\_stage\_build\_workflow | Full contents of the stage-build.yml for the alma-sapinvoices-ui repo |
291+
| tacos\_detectors\_dev\_build\_workflow | Full contents of the dev-build.yml for the tacos-detectors-lambdas repo |
292+
| tacos\_detectors\_makefile | Full contents of the Makefile for the tacos-detectors-lambdas repo (allows devs to push to Dev account only) |
293+
| tacos\_detectors\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the tacos-detectors-lambdas repo |
294+
| tacos\_detectors\_stage\_build\_workflow | Full contents of the stage-build.yml for the tacos-detectors-lambdas repo |
288295
| tim\_dev\_build\_workflow | Full contents of the dev-build.yml for the timdex-index-manager repo |
289296
| tim\_makefile | Full contents of the Makefile for the timdex-index-manager repo (allows devs to push to Dev account only) |
290297
| tim\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the timdex-index-manager repo |

apt_ecr.tf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,47 +21,47 @@ module "ecr_apt" {
2121

2222
## For archival-packaging-tool application repo and ECR repository
2323
# Outputs in dev
24-
output "apt_fargate_dev_build_workflow" {
24+
output "apt_dev_build_workflow" {
2525
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/dev-build.tpl", {
2626
region = var.aws_region
2727
role = module.ecr_apt.gha_role
2828
ecr = module.ecr_apt.repository_name
29-
function = ""
29+
function = local.ecr_apt
3030
}
3131
)
3232
description = "Full contents of the dev-build.yml for the archival-packaging-tool repo"
3333
}
34-
output "apt_fargate_makefile" {
34+
output "apt_makefile" {
3535
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile.tpl", {
3636
ecr_name = module.ecr_apt.repository_name
3737
ecr_url = module.ecr_apt.repository_url
38-
function = ""
38+
function = local.ecr_apt
3939
}
4040
)
4141
description = "Full contents of the Makefile for the archival-packaging-tool repo (allows devs to push to Dev account only)"
4242
}
4343

4444
# Outputs in stage
45-
output "apt_fargate_stage_build_workflow" {
45+
output "apt_stage_build_workflow" {
4646
value = var.environment == "prod" || var.environment == "dev" ? null : templatefile("${path.module}/files/stage-build.tpl", {
4747
region = var.aws_region
4848
role = module.ecr_apt.gha_role
4949
ecr = module.ecr_apt.repository_name
50-
function = ""
50+
function = local.ecr_apt
5151
}
5252
)
5353
description = "Full contents of the stage-build.yml for the archival-packaging-tool repo"
5454
}
5555

5656
# Outputs after promotion to prod
57-
output "apt_fargate_prod_promote_workflow" {
57+
output "apt_prod_promote_workflow" {
5858
value = var.environment == "stage" || var.environment == "dev" ? null : templatefile("${path.module}/files/prod-promote.tpl", {
5959
region = var.aws_region
6060
role_stage = "${module.ecr_apt.repo_name}-gha-stage"
6161
role_prod = "${module.ecr_apt.repo_name}-gha-prod"
6262
ecr_stage = "${module.ecr_apt.repo_name}-stage"
6363
ecr_prod = "${module.ecr_apt.repo_name}-prod"
64-
function = ""
64+
function = local.ecr_apt
6565
}
6666
)
6767
description = "Full contents of the prod-promote.yml for the archival-packaging-tool repo"

files/prod-promote-extra-region.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### This should be added to jobs section of the dev-build.yml.
1+
### This should be added to jobs section of the prod-promote.yml.
22
### If this is a Lambda function, uncomment the FUNCTION: line
33

44
deploy-${region}:

tacos_ecr.tf

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Tacos Detectors (tacos-detectors-lambdas) containers
2+
# A standard ECR for an ECS Fargate task
3+
4+
locals {
5+
ecr_tacos_detectors = "tacos-detectors-lambdas-${var.environment}"
6+
}
7+
8+
module "ecr_tacos_detectors" {
9+
source = "./modules/ecr"
10+
repo_name = "tacos-detectors-lambdas"
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 = "tacos-detectors-lambdas"
17+
}
18+
}
19+
20+
## Outputs to Terraform Cloud for devs ##
21+
22+
## For tacos-detectors-lambdas application repo and ECR repository
23+
# Outputs in dev
24+
output "tacos_detectors_dev_build_workflow" {
25+
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/dev-build.tpl", {
26+
region = var.aws_region
27+
role = module.ecr_tacos_detectors.gha_role
28+
ecr = module.ecr_tacos_detectors.repository_name
29+
function = local.ecr_tacos_detectors
30+
}
31+
)
32+
description = "Full contents of the dev-build.yml for the tacos-detectors-lambdas repo"
33+
}
34+
output "tacos_detectors_makefile" {
35+
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile.tpl", {
36+
ecr_name = module.ecr_tacos_detectors.repository_name
37+
ecr_url = module.ecr_tacos_detectors.repository_url
38+
function = local.ecr_tacos_detectors
39+
}
40+
)
41+
description = "Full contents of the Makefile for the tacos-detectors-lambdas repo (allows devs to push to Dev account only)"
42+
}
43+
44+
# Outputs in stage
45+
output "tacos_detectors_stage_build_workflow" {
46+
value = var.environment == "prod" || var.environment == "dev" ? null : templatefile("${path.module}/files/stage-build.tpl", {
47+
region = var.aws_region
48+
role = module.ecr_tacos_detectors.gha_role
49+
ecr = module.ecr_tacos_detectors.repository_name
50+
function = local.ecr_tacos_detectors
51+
}
52+
)
53+
description = "Full contents of the stage-build.yml for the tacos-detectors-lambdas repo"
54+
}
55+
56+
# Outputs after promotion to prod
57+
output "tacos_detectors_prod_promote_workflow" {
58+
value = var.environment == "stage" || var.environment == "dev" ? null : templatefile("${path.module}/files/prod-promote.tpl", {
59+
region = var.aws_region
60+
role_stage = "${module.ecr_tacos_detectors.repo_name}-gha-stage"
61+
role_prod = "${module.ecr_tacos_detectors.repo_name}-gha-prod"
62+
ecr_stage = "${module.ecr_tacos_detectors.repo_name}-stage"
63+
ecr_prod = "${module.ecr_tacos_detectors.repo_name}-prod"
64+
function = local.ecr_tacos_detectors
65+
}
66+
)
67+
description = "Full contents of the prod-promote.yml for the tacos-detectors-lambdas repo"
68+
}

0 commit comments

Comments
 (0)