Skip to content

Commit 0fff0d3

Browse files
committed
move ecr to other modules
1 parent fb80c86 commit 0fff0d3

File tree

7 files changed

+51
-7
lines changed

7 files changed

+51
-7
lines changed

terraform/040-id-broker/main.tf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ module "ecsservice" {
221221
cluster_id = var.ecs_cluster_id
222222
service_name = "${var.idp_name}-${var.app_name}"
223223
service_env = var.app_env
224-
ecsServiceRole_arn = var.ecsServiceRole_arn
224+
ecsServiceRole_arn = var.ecs_service_role_arn
225225
container_def_json = local.task_def
226226
desired_count = var.desired_count
227227
tg_arn = aws_alb_target_group.broker.arn
@@ -403,6 +403,16 @@ resource "aws_iam_policy" "cd" {
403403
})
404404
}
405405

406+
module "ecr" {
407+
source = "github.com/silinternational/terraform-modules//aws/ecr?ref=8.13.2"
408+
repo_name = "${var.idp_name}/id-broker"
409+
ecsInstanceRole_arn = var.ecs_instance_role_arn
410+
ecsServiceRole_arn = var.ecs_service_role_arn
411+
cd_user_arn = var.cd_principal_arn
412+
image_retention_count = 10
413+
image_retention_tags = ["latest"]
414+
}
415+
406416
/*
407417
* AWS data
408418
*/

terraform/050-pw-manager/main.tf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ module "ecsservice" {
128128
tg_arn = aws_alb_target_group.pwmanager.arn
129129
lb_container_name = "web"
130130
lb_container_port = "80"
131-
ecsServiceRole_arn = var.ecsServiceRole_arn
131+
ecsServiceRole_arn = var.ecs_service_role_arn
132132
task_role_arn = module.ecs_role.role_arn
133133
}
134134

@@ -222,6 +222,16 @@ resource "aws_iam_policy" "cd" {
222222
})
223223
}
224224

225+
module "ecr" {
226+
source = "github.com/silinternational/terraform-modules//aws/ecr?ref=8.13.2"
227+
repo_name = "${var.idp_name}/pw-api"
228+
ecsInstanceRole_arn = var.ecs_instance_role_arn
229+
ecsServiceRole_arn = var.ecs_service_role_arn
230+
cd_user_arn = var.cd_principal_arn
231+
image_retention_count = 10
232+
image_retention_tags = ["latest"]
233+
}
234+
225235
/*
226236
* AWS data
227237
*/

terraform/050-pw-manager/variables.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,19 @@ variable "ecs_cluster_id" {
131131
variable "ecsServiceRole_arn" {
132132
description = "ARN for ECS Service Role"
133133
type = string
134+
variable "cd_principal_arn" {
135+
description = "The ARN of the user or role that will push images to ECR for this service."
136+
type = string
137+
}
138+
139+
variable "ecs_instance_role_arn" {
140+
description = "The ARN of the role that will be passed to ECS and ECR as the instance role."
141+
type = string
142+
}
143+
144+
variable "ecs_service_role_arn" {
145+
description = "The ARN of the role that will be passed to ECR as the service role."
146+
type = string
134147
}
135148

136149
variable "email_signature" {

terraform/060-simplesamlphp/main.tf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ module "ecsservice" {
121121
tg_arn = aws_alb_target_group.ssp.arn
122122
lb_container_name = "web"
123123
lb_container_port = "80"
124-
ecsServiceRole_arn = var.ecsServiceRole_arn
124+
ecsServiceRole_arn = var.ecs_service_role_arn
125125
task_role_arn = module.ecs_role.role_arn
126126
}
127127

@@ -215,6 +215,16 @@ resource "aws_iam_policy" "cd" {
215215
})
216216
}
217217

218+
module "ecr_simplesamlphp" {
219+
source = "github.com/silinternational/terraform-modules//aws/ecr?ref=8.13.2"
220+
repo_name = "${var.idp_name}/simplesamlphp"
221+
ecsInstanceRole_arn = var.ecs_instance_role_arn
222+
ecsServiceRole_arn = var.ecs_service_role_arn
223+
cd_user_arn = var.cd_principal_arn
224+
image_retention_count = 10
225+
image_retention_tags = ["latest"]
226+
}
227+
218228
/*
219229
* AWS data
220230
*/

test/040-id-broker.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module "broker" {
66
abandoned_user_deactivate_instructions_url = ""
77
app_env = ""
88
app_name = ""
9+
cd_principal_arn = ""
910
cloudflare_domain = ""
1011
cloudwatch_log_group_name = ""
1112
contingent_user_duration = ""
@@ -14,7 +15,6 @@ module "broker" {
1415
db_name = ""
1516
desired_count = 1
1617
docker_image = ""
17-
ecsServiceRole_arn = ""
1818
ecs_cluster_id = ""
1919
email_repeat_delay_days = 1
2020
email_signature = ""

test/050-pw-manager.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module "pw" {
1313
auth_saml_signRequest = true
1414
auth_saml_spCertificate = ""
1515
auth_saml_spPrivateKey = ""
16+
cd_principal_arn = ""
1617
cloudflare_domain = ""
1718
cloudwatch_log_group_name = ""
1819
code_length = 1
@@ -21,8 +22,9 @@ module "pw" {
2122
db_name = ""
2223
desired_count = 1
2324
docker_image = ""
24-
ecsServiceRole_arn = ""
2525
ecs_cluster_id = ""
26+
ecs_instance_role_arn = ""
27+
ecs_service_role_arn = ""
2628
email_signature = ""
2729
extra_hosts = ""
2830
help_center_url = ""

test/060-simplesamlphp.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ module "ssp" {
88
analytics_id = ""
99
app_env = ""
1010
app_name = ""
11-
cduser_username = ""
11+
cd_principal_arn = ""
1212
cloudflare_domain = ""
1313
cloudwatch_log_group_name = ""
1414
cpu = 1
1515
create_dns_record = true
1616
db_name = ""
1717
desired_count = 1
1818
docker_image = ""
19-
ecsServiceRole_arn = ""
2019
ecs_cluster_id = ""
2120
enable_debug = true
2221
help_center_url = ""

0 commit comments

Comments
 (0)