Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ This is a core infrastructure repository that defines infrastructure related to
| ecr\_timdex\_transmogrifier | ./modules/ecr | n/a |
| ecr\_wcd2reshare | ./modules/ecr | n/a |
| ecr\_wiley | ./modules/ecr | n/a |
| ecr\_workflowtest | ./modules/ecr | n/a |

## Resources

Expand Down Expand Up @@ -320,4 +321,8 @@ This is a core infrastructure repository that defines infrastructure related to
| wiley\_fargate\_makefile | Full contents of the Makefile for the wiley-deposits repo (allows devs to push to Dev account only) |
| wiley\_fargate\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the wiley-deposits repo |
| wiley\_fargate\_stage\_build\_workflow | Full contents of the stage-build.yml for the wiley-deposits repo |
| workflowtest\_dev\_build\_workflow | Full contents of the dev-build.yml for the ecr-workflow-test repo |
| workflowtest\_makefile | Full contents of the Makefile for the ecr-workflow-test repo (allows devs to push to Dev account only) |
| workflowtest\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the ecr-workflow-test repo |
| workflowtest\_stage\_build\_workflow | Full contents of the stage-build.yml for the ecr-workflow-test repo |
<!-- END_TF_DOCS -->
68 changes: 68 additions & 0 deletions ect_workflow_text_ecr.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

# ecr-workflow-test containers
# This is a standard ECR for an ECS with a Fargate launch type
locals {
ecr_workflowtest = "workflowtest-${var.environment}"
}
module "ecr_workflowtest" {
source = "./modules/ecr"
repo_name = "ecr-workflow-test"
login_policy_arn = aws_iam_policy.login.arn
oidc_arn = data.aws_ssm_parameter.oidc_arn.value
environment = var.environment
tfoutput_ssm_path = var.tfoutput_ssm_path
tags = {
app-repo = "ecr-workflow-test"
}
}


## Outputs to Terraform Cloud for devs ##

## For workflowtest application repo and ECR repository
# Outputs in dev
output "workflowtest_dev_build_workflow" {
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/dev-build.tpl", {
region = var.aws_region
role = module.ecr_workflowtest.gha_role
ecr = module.ecr_workflowtest.repository_name
function = ""
}
)
description = "Full contents of the dev-build.yml for the ecr-workflow-test repo"
}
output "workflowtest_makefile" {
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile.tpl", {
ecr_name = module.ecr_workflowtest.repository_name
ecr_url = module.ecr_workflowtest.repository_url
function = ""
}
)
description = "Full contents of the Makefile for the ecr-workflow-test repo (allows devs to push to Dev account only)"
}

# Outputs in stage
output "workflowtest_stage_build_workflow" {
value = var.environment == "prod" || var.environment == "dev" ? null : templatefile("${path.module}/files/stage-build.tpl", {
region = var.aws_region
role = module.ecr_workflowtest.gha_role
ecr = module.ecr_workflowtest.repository_name
function = ""
}
)
description = "Full contents of the stage-build.yml for the ecr-workflow-test repo"
}

# Outputs after promotion to prod
output "workflowtest_prod_promote_workflow" {
value = var.environment == "stage" || var.environment == "dev" ? null : templatefile("${path.module}/files/prod-promote.tpl", {
region = var.aws_region
role_stage = "${module.ecr_workflowtest.repo_name}-gha-stage"
role_prod = "${module.ecr_workflowtest.repo_name}-gha-prod"
ecr_stage = "${module.ecr_workflowtest.repo_name}-stage"
ecr_prod = "${module.ecr_workflowtest.repo_name}-prod"
function = ""
}
)
description = "Full contents of the prod-promote.yml for the ecr-workflow-test repo"
}