File tree 5 files changed +35
-30
lines changed
5 files changed +35
-30
lines changed Original file line number Diff line number Diff line change 1
1
# load balancer ARN arn:aws:acm:us-east-2:633607774026:certificate/8de9fd02-191c-485f-b952-e5ba32e90acb
2
2
# ###############################################################################
3
+
4
+ # https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group
3
5
resource "aws_security_group" "lb_security_group" {
4
6
name_prefix = " ecs"
5
7
vpc_id = data. aws_vpc . use2 . id
6
8
7
9
# allow incoming traffic
8
10
ingress {
9
- from_port = 443
10
- to_port = 443
11
- protocol = " tcp"
12
- cidr_blocks = [" 0.0.0.0/0" ]
11
+ from_port = 443
12
+ to_port = 443
13
+ protocol = " tcp"
14
+ cidr_blocks = [" 0.0.0.0/0" ]
15
+ ipv6_cidr_blocks = [" ::/0" ]
13
16
}
14
17
ingress {
15
- from_port = 80
16
- to_port = 80
17
- protocol = " tcp"
18
- cidr_blocks = [" 0.0.0.0/0" ]
18
+ from_port = 80
19
+ to_port = 80
20
+ protocol = " tcp"
21
+ cidr_blocks = [" 0.0.0.0/0" ]
22
+ ipv6_cidr_blocks = [" ::/0" ]
19
23
}
20
24
21
25
# allow all outgoing traffic
@@ -31,12 +35,14 @@ resource "aws_security_group" "lb_security_group" {
31
35
}
32
36
}
33
37
38
+ # https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb
34
39
resource "aws_lb" "ecs" {
35
40
name_prefix = " oc"
36
41
security_groups = [aws_security_group . lb_security_group . id ]
37
42
38
43
load_balancer_type = " application"
39
44
internal = false
45
+ ip_address_type = " dualstack"
40
46
41
47
subnets = data. aws_subnets . use2 . ids
42
48
Original file line number Diff line number Diff line change 1
1
2
2
# https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#ecs-optimized-ami-linux
3
3
data "aws_ssm_parameter" "ecs_optimized_ami" {
4
- name = " /aws/service/ecs/optimized-ami/amazon-linux-2 /recommended"
4
+ name = " /aws/service/ecs/optimized-ami/amazon-linux-2023 /recommended"
5
5
}
6
6
7
7
# https://registry.terraform.io/modules/terraform-aws-modules/autoscaling/aws/latest
@@ -37,7 +37,7 @@ module "autoscaling" {
37
37
{
38
38
delete_on_termination = true
39
39
device_index = 0
40
- associate_public_ip_address = true
40
+ associate_public_ip_address = false
41
41
security_groups = [module.autoscaling_sg.security_group_id]
42
42
}
43
43
]
Original file line number Diff line number Diff line change @@ -108,5 +108,5 @@ resource "aws_lb_target_group" "pybot" {
108
108
unhealthy_threshold = 2
109
109
}
110
110
111
- deregistration_delay = 300
111
+ deregistration_delay = 10
112
112
}
Original file line number Diff line number Diff line change @@ -145,5 +145,5 @@ resource "aws_lb_target_group" "python_backend" {
145
145
unhealthy_threshold = 2
146
146
}
147
147
148
- deregistration_delay = 300
148
+ deregistration_delay = 10
149
149
}
You can’t perform that action at this time.
0 commit comments