-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathalb.tf
94 lines (85 loc) · 2.3 KB
/
alb.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
###################################################
# Application Load Balancer
###################################################
module "alb" {
source = "../../modules/alb"
# source = "tedilabs/load-balancer/aws//modules/alb"
# version = "~> 1.0.0"
name = "tedilabs-nlb-alb-alb"
is_public = false
ip_address_type = "IPV4"
vpc_id = data.aws_vpc.default.id
network_mapping = {
for az, subnet in data.aws_subnet.default :
az => {
subnet = subnet.id
}
}
default_security_group = {
enabled = true
name = "tedilabs-nlb-alb-alb"
description = "Managed by Terraform."
listener_ingress_ipv4_cidrs = ["10.0.0.0/8", "172.31.0.0/16"]
}
security_groups = []
## Attributes
desync_mitigation_mode = "DEFENSIVE"
drop_invalid_header_fields = false
deletion_protection_enabled = false
http2_enabled = true
waf_fail_open_enabled = false
idle_timeout = 60
listeners = [
{
port = 80
protocol = "HTTP"
default_action_type = "REDIRECT_301"
default_action_parameters = {
protocol = "HTTPS"
port = 443
}
rules = [
{
priority = 10
conditions = [
{
type = "PATH"
values = ["/ping"]
}
]
action_type = "FIXED_RESPONSE"
action_parameters = {
status_code = 200
content_type = "application/json"
data = <<EOF
{"status":"success","metadata":{"statusCode":"200"}}
EOF
}
}
]
},
# {
# port = 443
# protocol = "HTTPS"
# default_action_type = "FIXED_RESPONSE"
# default_action_parameters = {
# content_type = "application/json"
# status_code = 404
# data = <<EOF
# {"status":"fail","metadata":{"statusCode":"404","code":"UNKNOWN_ENDPOINT","description":"The requested endpoint does not exist."}}
# EOF
# }
# },
]
## Access Log
access_log = {
enabled = false
s3_bucket = {
name = "my-bucket"
key_prefix = "/tedilabs-nlb-alb-alb/"
}
}
tags = {
"project" = "terraform-aws-load-balancer-examples"
}
}