File tree Expand file tree Collapse file tree 11 files changed +64
-79
lines changed Expand file tree Collapse file tree 11 files changed +64
-79
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,12 @@ No resources.
146
146
147
147
## Outputs
148
148
149
- No outputs.
149
+ | Name | Description |
150
+ | ------| -------------|
151
+ | <a name =" output_ecs_cluster_name " ></a > [ ecs\_ cluster\_ name] ( #output\_ ecs\_ cluster\_ name ) | The name of the ECS cluster |
152
+ | <a name =" output_ecs_service_arn " ></a > [ ecs\_ service\_ arn] ( #output\_ ecs\_ service\_ arn ) | The ARN of the ECS service |
153
+ | <a name =" output_ecs_service_name " ></a > [ ecs\_ service\_ name] ( #output\_ ecs\_ service\_ name ) | The name of the ECS service |
154
+ | <a name =" output_ecs_task_definition_arn " ></a > [ ecs\_ task\_ definition\_ arn] ( #output\_ ecs\_ task\_ definition\_ arn ) | The ARN of the ECS task definition |
150
155
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
151
156
152
157
## Development
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ module "tags" {
30
30
31
31
module "ecs_cluster" {
32
32
source = " ../../"
33
- # for_each = local.ecs_services
34
33
35
34
ecs_cluster = local. ecs_cluster
36
35
capacity_provider = local. capacity_provider
@@ -40,24 +39,6 @@ module "ecs_cluster" {
40
39
tags = module. tags . tags
41
40
}
42
41
43
- # module "ecs_cluster" {
44
- # source = "../../"
45
- # for_each = local.ecs_services
46
-
47
- # ecs_cluster = local.ecs_cluster
48
- # capacity_provider = local.capacity_provider
49
- # launch_template = local.launch_template
50
- # asg = local.asg
51
- # ecs_service = each.value.ecs_service
52
- # task = each.value.task
53
- # lb_data = each.value.lb_data
54
- # vpc_id = data.aws_vpc.default.id
55
- # target_group_arn = module.alb.target_group_arn
56
- # environment = var.environment
57
- # tags = module.tags.tags
58
- # depends_on = [module.alb]
59
- # }
60
-
61
42
module "ecs_services" {
62
43
for_each = local. ecs_services
63
44
Original file line number Diff line number Diff line change
1
+ output "ecs_cluster_name" {
2
+ description = " The name of the ECS cluster"
3
+ value = module. ecs_cluster . ecs_cluster_name
4
+ }
5
+
6
+ output "ecs_service_name" {
7
+ description = " The name of the ECS service"
8
+ value = module. ecs_services . service_name
9
+ }
10
+
11
+ output "ecs_service_arn" {
12
+ description = " The ARN of the ECS service"
13
+ value = module. ecs_services . ecs_service_arn
14
+ }
15
+
16
+ output "ecs_task_definition_arn" {
17
+ description = " The ARN of the ECS task definition"
18
+ value = module. ecs_services . ecs_task_definition_arn
19
+ }
Original file line number Diff line number Diff line change @@ -59,8 +59,7 @@ locals {
59
59
container_definition = " container/container_definition.json.tftpl"
60
60
}
61
61
62
- lb = {
63
- name = " arc-load-balancer"
62
+ lb_data = {
64
63
listener_port = 80
65
64
security_group_id = " sg-023e8f71ae18450ff"
66
65
}
@@ -91,8 +90,7 @@ locals {
91
90
container_definition = " container/container_definition.json.tftpl"
92
91
}
93
92
94
- lb = {
95
- name = " arc-load-balancer"
93
+ lb_data = {
96
94
listener_port = 80
97
95
security_group_id = " sg-023e8f71ae18450ff"
98
96
}
Original file line number Diff line number Diff line change @@ -28,22 +28,6 @@ module "tags" {
28
28
}
29
29
}
30
30
31
- # module "ecs_cluster" {
32
- # source = "../../"
33
-
34
- # ecs_cluster = local.ecs_cluster
35
- # capacity_provider = local.capacity_provider
36
- # environment = var.environment
37
- # ecs_service = local.ecs_service
38
- # task = local.task
39
- # lb = local.lb
40
- # vpc_id = data.aws_vpc.default.id
41
- # alb_name = local.load_balancer_config.name
42
- # target_group_arn = module.alb.target_group_arn
43
- # tags = module.tags.tags
44
- # depends_on = [module.alb]
45
- # }
46
-
47
31
48
32
module "ecs_cluster" {
49
33
source = " ../../"
@@ -62,7 +46,7 @@ module "ecs_services" {
62
46
ecs_cluster_name = local. ecs_cluster . name
63
47
ecs_service = each. value . ecs_service
64
48
task = each. value . task
65
- lb = each. value . lb
49
+ lb_data = each. value . lb_data
66
50
vpc_id = data. aws_vpc . default . id
67
51
target_group_arn = module. alb . target_group_arn
68
52
environment = var. environment
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ module "ecs_service" {
37
37
target_group_arn = var. target_group_arn
38
38
39
39
ecs_service = {
40
- # cluster_name = module.ecs_cluster[0].ecs_cluster.name
41
40
cluster_name = var.ecs_cluster_name
42
41
service_name = var.ecs_service.service_name
43
42
repository_name = var.ecs_service.repository_name
Original file line number Diff line number Diff line change @@ -12,21 +12,6 @@ terraform {
12
12
}
13
13
}
14
14
15
- # #######################################################################
16
- # CloudWatch Log Group
17
- # #######################################################################
18
- # resource "aws_cloudwatch_log_group" "this" {
19
- # count = var.ecs_cluster.create_cloudwatch_log_group ? 1 : 0
20
-
21
- # name = var.ecs_cluster.configuration.execute_command_configuration.log_configuration.log_group_name != null ? var.ecs_cluster.configuration.execute_command_configuration.log_configuration.log_group_name : "/aws/ecs/${var.ecs_cluster.name}"
22
-
23
- # retention_in_days = var.ecs_cluster.configuration.execute_command_configuration.log_configuration.log_group_retention_in_days
24
- # kms_key_id = var.ecs_cluster.configuration.execute_command_configuration.log_configuration.log_group_kms_key_id
25
-
26
- # tags = merge(var.tags, var.ecs_cluster.configuration.execute_command_configuration.log_configuration.log_group_tags)
27
- # }
28
-
29
-
30
15
# #######################################################################
31
16
# ECS Cluster
32
17
# #######################################################################
Original file line number Diff line number Diff line change @@ -4,3 +4,8 @@ output "ecs_cluster" {
4
4
id = aws_ecs_cluster.this.id
5
5
}
6
6
}
7
+
8
+ output "launch_template_id" {
9
+ description = " The ID of the EC2 launch template"
10
+ value = var. capacity_provider . use_fargate ? null : aws_launch_template. this [0 ]. id
11
+ }
Original file line number Diff line number Diff line change @@ -2,3 +2,18 @@ output "service_name" {
2
2
description = " The name of the ECS service."
3
3
value = aws_ecs_service. this . name
4
4
}
5
+
6
+ output "ecs_task_definition_arn" {
7
+ description = " The ARN of the ECS task definition"
8
+ value = aws_ecs_task_definition. this . arn
9
+ }
10
+
11
+ output "ecs_task_role_arn" {
12
+ description = " The ARN of the IAM role assigned to the ECS task"
13
+ value = aws_iam_role. task_role . arn
14
+ }
15
+
16
+ output "ecs_service_arn" {
17
+ description = " The ARN of the ECS service"
18
+ value = aws_ecs_service. this . id
19
+ }
Original file line number Diff line number Diff line change 1
- # output "ecs_cluster_name" {
2
- # description = "The name of the ECS cluster. "
3
- # value = module.ecs_cluster[0].ecs_cluster.name
4
- # }
1
+ output "ecs_cluster_name" {
2
+ description = " The name of the ECS cluster"
3
+ value = module. ecs_cluster [0 ]. ecs_cluster
4
+ }
5
5
6
- # output "alb_name " {
7
- # description = "The names of the ALBs. "
8
- # value = [for alb in module.alb : alb.alb.name]
9
- # }
6
+ output "ecs_service_name " {
7
+ description = " The name of the ECS service "
8
+ value = module. ecs_service [ 0 ] . service_name
9
+ }
10
10
11
- # output "ecs_service_name " {
12
- # description = "The service names of the ECS services. "
13
- # value = module.ecs_service[*].service_name
14
- # }
11
+ output "ecs_service_arn " {
12
+ description = " The ARN of the ECS service "
13
+ value = module. ecs_service [0 ] . ecs_service_arn
14
+ }
15
15
16
- # output "ecs_task_definition_arn" {
17
- # description = "The ARNs of the ECS task definitions. "
18
- # value = module.ecs_service[*].task_definition_arn
19
- # }
16
+ output "ecs_task_definition_arn" {
17
+ description = " The ARN of the ECS task definition "
18
+ value = module. ecs_service [0 ] . ecs_task_definition_arn
19
+ }
You can’t perform that action at this time.
0 commit comments