Skip to content

Commit f66f998

Browse files
authored
Merge pull request #73 from MITLibraries/dev
Dev-to-Stage: Create ECR Repository for timdex-embeddings
2 parents dcf84ae + 752acae commit f66f998

File tree

3 files changed

+74
-3
lines changed

3 files changed

+74
-3
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: "v1.100.0"
3+
rev: "v1.103.0"
44
hooks:
55
- id: terraform_fmt
66
args:
@@ -12,7 +12,7 @@ repos:
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.471'
15+
rev: '3.2.490'
1616
hooks:
1717
- id: checkov
1818
verbose: false

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ This is a core infrastructure repository that defines infrastructure related to
130130
* [TIMDEX UI](https://github.com/MITLibraries/timdex-ui)
131131
* [TIMDEX Simulator](https://github.com/MITLibraries/timdex-simulator)
132132
* [TIMDEX Transmogrifier](https://github.com/MITLibraries/transmogrifier)
133+
* [TIMDEX Embeddings](https://github.com/MITLibraries/timdex-embeddings)
133134
* [WCD2Reshare](https://github.com/MITLibraries/mitlib-tf-workloads-wcd2reshare)
134135
* [WCD2Reshare Application Container](https://github.com/MITLibraries/wcd2reshare)
135136
* **DEPRECATED**: [Wiley](https://github.com/MITLibraries/mitlib-tf-workloads-wiley)
@@ -139,7 +140,7 @@ This is a core infrastructure repository that defines infrastructure related to
139140

140141
* Owner: See [CODEOWNERS](./.github/CODEOWNERS)
141142
* Team: See [CODEOWNERS](./.github/CODEOWNERS)
142-
* Last Maintenance: 2025-09
143+
* Last Maintenance: 2025-11
143144

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

@@ -182,6 +183,7 @@ This is a core infrastructure repository that defines infrastructure related to
182183
| ecr\_sapinvoices\_ui | ./modules/ecr | n/a |
183184
| ecr\_tacos\_detectors | ./modules/ecr | n/a |
184185
| ecr\_timdex\_browsertrix | ./modules/ecr | n/a |
186+
| ecr\_timdex\_embeddings | ./modules/ecr | n/a |
185187
| ecr\_timdex\_geo | ./modules/ecr | n/a |
186188
| ecr\_timdex\_lambdas | ./modules/ecr | n/a |
187189
| ecr\_timdex\_tim | ./modules/ecr | n/a |
@@ -307,6 +309,10 @@ This is a core infrastructure repository that defines infrastructure related to
307309
| tim\_makefile | Full contents of the Makefile for the timdex-index-manager repo (allows devs to push to Dev account only) |
308310
| tim\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the timdex-index-manager repo |
309311
| tim\_stage\_build\_workflow | Full contents of the stage-build.yml for the timdex-index-manager repo |
312+
| timdex\_embeddings\_fargate\_dev\_build\_workflow | Full contents of the dev-build.yml for the timdex-embeddings repo |
313+
| timdex\_embeddings\_fargate\_makefile | Full contents of the Makefile for the timdex-embeddings repo (allows devs to push to Dev account only) |
314+
| timdex\_embeddings\_fargate\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the timdex-embeddings repo |
315+
| timdex\_embeddings\_fargate\_stage\_build\_workflow | Full contents of the stage-build.yml for the timdex-embeddings repo |
310316
| timdex\_lambdas\_dev\_build\_workflow | Full contents of the dev-build.yml for the timdex-pipeline-lambdas repo |
311317
| timdex\_lambdas\_makefile | Full contents of the Makefile for the timdex-pipeline-lambdas repo (allows devs to push to Dev account only) |
312318
| timdex\_lambdas\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the timdex-pipeline-lambdas repo |

timdex_ecrs.tf

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,3 +365,68 @@ output "geo_prod_promote_workflow" {
365365
)
366366
description = "Full contents of the prod-promote.yml for the geo-harvester repo"
367367
}
368+
369+
370+
# timdex-embeddings containers
371+
# This is a standard ECR for an ECS with a Fargate launch type
372+
module "ecr_timdex_embeddings" {
373+
source = "./modules/ecr"
374+
repo_name = "timdex-embeddings"
375+
login_policy_arn = aws_iam_policy.login.arn
376+
oidc_arn = data.aws_ssm_parameter.oidc_arn.value
377+
environment = var.environment
378+
tfoutput_ssm_path = var.tfoutput_ssm_path
379+
tags = {
380+
app-repo = "timdex-infrastructure-timdex-embeddings"
381+
}
382+
}
383+
384+
## Outputs to Terraform Cloud for devs ##
385+
386+
## For timdex-embeddings application repo and ECR repository
387+
# Outputs in dev
388+
output "timdex_embeddings_fargate_dev_build_workflow" {
389+
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/dev-build-cpu-arch.tpl", {
390+
region = var.aws_region
391+
role = module.ecr_timdex_embeddings.gha_role
392+
ecr = module.ecr_timdex_embeddings.repository_name
393+
function = ""
394+
}
395+
)
396+
description = "Full contents of the dev-build.yml for the timdex-embeddings repo"
397+
}
398+
output "timdex_embeddings_fargate_makefile" {
399+
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile-cpu-arch.tpl", {
400+
ecr_name = module.ecr_timdex_embeddings.repository_name
401+
ecr_url = module.ecr_timdex_embeddings.repository_url
402+
function = ""
403+
}
404+
)
405+
description = "Full contents of the Makefile for the timdex-embeddings repo (allows devs to push to Dev account only)"
406+
}
407+
408+
# Outputs in stage
409+
output "timdex_embeddings_fargate_stage_build_workflow" {
410+
value = var.environment == "prod" || var.environment == "dev" ? null : templatefile("${path.module}/files/stage-build-cpu-arch.tpl", {
411+
region = var.aws_region
412+
role = module.ecr_timdex_embeddings.gha_role
413+
ecr = module.ecr_timdex_embeddings.repository_name
414+
function = ""
415+
}
416+
)
417+
description = "Full contents of the stage-build.yml for the timdex-embeddings repo"
418+
}
419+
420+
# Outputs after promotion to prod
421+
output "timdex_embeddings_fargate_prod_promote_workflow" {
422+
value = var.environment == "stage" || var.environment == "dev" ? null : templatefile("${path.module}/files/prod-promote-cpu-arch.tpl", {
423+
region = var.aws_region
424+
role_stage = "${module.ecr_timdex_embeddings.repo_name}-gha-stage"
425+
role_prod = "${module.ecr_timdex_embeddings.repo_name}-gha-prod"
426+
ecr_stage = "${module.ecr_timdex_embeddings.repo_name}-stage"
427+
ecr_prod = "${module.ecr_timdex_embeddings.repo_name}-prod"
428+
function = ""
429+
}
430+
)
431+
description = "Full contents of the prod-promote.yml for the timdex-embeddings repo"
432+
}

0 commit comments

Comments
 (0)