diff --git a/README.md b/README.md index ce1c32a..39a6803 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 | diff --git a/ect_workflow_text_ecr.tf b/ect_workflow_text_ecr.tf new file mode 100644 index 0000000..5baa1f0 --- /dev/null +++ b/ect_workflow_text_ecr.tf @@ -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" +}