generated from MITLibraries/mitlib-tf-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwcd2reshare.tf
67 lines (62 loc) · 2.54 KB
/
wcd2reshare.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# wcd2reshare
# Since this is a Lambda function, we need to set the function name now
# in order to build the correct files.
locals {
ecr_wcd2reshare_function_name = "wcd2reshare-${var.environment}"
}
module "ecr_wcd2reshare" {
source = "./modules/ecr"
repo_name = "wcd2reshare"
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 = "wcd2reshare"
}
}
## For wcd2reshare application repo and ECR repository
# Outputs in dev
output "wcd2reshare_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_wcd2reshare.gha_role
ecr = module.ecr_wcd2reshare.repository_name
function = local.ecr_wcd2reshare_function_name
}
)
description = "Full contents of the dev-build.yml for the wcd2reshare repo"
}
output "wcd2reshare_makefile" {
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile.tpl", {
ecr_name = module.ecr_wcd2reshare.repository_name
ecr_url = module.ecr_wcd2reshare.repository_url
function = local.ecr_wcd2reshare_function_name
}
)
description = "Full contents of the Makefile for the wcd2reshare repo (allows devs to push to Dev account only)"
}
# Outputs in stage
output "wcd2reshare_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_wcd2reshare.gha_role
ecr = module.ecr_wcd2reshare.repository_name
function = local.ecr_wcd2reshare_function_name
}
)
description = "Full contents of the stage-build.yml for the wcd2reshare repo"
}
# Outputs after promotion to prod
output "wcd2reshare_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_wcd2reshare.repo_name}-gha-stage"
role_prod = "${module.ecr_wcd2reshare.repo_name}-gha-prod"
ecr_stage = "${module.ecr_wcd2reshare.repo_name}-stage"
ecr_prod = "${module.ecr_wcd2reshare.repo_name}-prod"
function = local.ecr_wcd2reshare_function_name
}
)
description = "Full contents of the prod-promote.yml for the wcd2reshare repo"
}