Skip to content

Commit be8522b

Browse files
authored
Merge pull request #44 from clouddrove/issue-244
fix: update main.tf, version.tf and github action and add locals in e…
2 parents 545275d + ef91c0c commit be8522b

20 files changed

+1100
-309
lines changed

.editorconfig

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
# Uses editorconfig to maintain consistent coding styles
3+
4+
# top-most EditorConfig file
5+
root = true
6+
7+
# Unix-style newlines with a newline ending every file
8+
[*]
9+
charset = utf-8
10+
end_of_line = lf
11+
indent_size = 2
12+
indent_style = space
13+
insert_final_newline = true
14+
max_line_length = 80
15+
trim_trailing_whitespace = true
16+
17+
[*.{tf,tfvars}]
18+
indent_size = 2
19+
indent_style = space
20+
21+
[*.md]
22+
max_line_length = 0
23+
trim_trailing_whitespace = false
24+
25+
[Makefile]
26+
tab_width = 2
27+
indent_style = tab
28+
29+
[COMMIT_EDITMSG]
30+
max_line_length = 0

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# These owners will be the default owners for everything in the repo.
2-
* @anmolnagpal @clouddrove/approvers @clouddrove-ci
2+
* @anmolnagpal @clouddrove/approvers @clouddrove-ci

.github/workflows/auto_assignee.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
name: Auto Assign PRs
2-
32
on:
43
pull_request:
54
types: [opened, reopened]
6-
75
workflow_dispatch:
86
jobs:
97
assignee:
108
uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@master
119
secrets:
1210
GITHUB: ${{ secrets.GITHUB }}
1311
with:
14-
assignees: 'clouddrove-ci'
12+
assignees: 'clouddrove-ci'

.github/workflows/readme.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ on:
33
push:
44
branches:
55
- master
6-
76
jobs:
87
readme:
98
name: 'readme-create'
@@ -25,6 +24,7 @@ jobs:
2524
env:
2625
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2726

27+
2828
- name: 'pre-commit check errors'
2929
uses: pre-commit/action@v3.0.0
3030
continue-on-error: true

.github/workflows/tflint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request:
66
workflow_dispatch:
77
jobs:
8-
tflint:
9-
uses: clouddrove/test-tfsec/.github/workflows/tflint.yaml@master
8+
tf-lint:
9+
uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@master
1010
secrets:
1111
GITHUB: ${{ secrets.GITHUB }}

.github/workflows/tfsec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ jobs:
88
uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@master
99
secrets: inherit
1010
with:
11-
working_directory: '.'
11+
working_directory: '.'

README.yaml

Lines changed: 86 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ badges:
2525
image: "https://img.shields.io/badge/License-APACHE-blue.svg"
2626
url: "LICENSE.md"
2727

28+
prerequesties:
29+
- name: Terraform 1.5.3
30+
url: https://learn.hashicorp.com/terraform/getting-started/install.html
2831
# description of this project
2932
description: |-
3033
This terraform module is used to create ALB on AWS.
@@ -41,15 +44,16 @@ usage : |-
4144
module "alb" {
4245
source = "clouddrove/alb/aws"
4346
version = "1.4.0"
44-
name = "alb"
47+
name = local.name
4548
enable = true
4649
internal = true
4750
load_balancer_type = "application"
4851
instance_count = module.ec2.instance_count
49-
security_groups = [module.ssh.security_group_ids, module.http_https.security_group_ids]
5052
subnets = module.public_subnets.public_subnet_id
5153
target_id = module.ec2.instance_id
5254
vpc_id = module.vpc.vpc_id
55+
allowed_ip = [module.vpc.vpc_cidr_block]
56+
allowed_ports = [3306]
5357
listener_certificate_arn = module.acm.arn
5458
enable_deletion_protection = false
5559
with_target_group = true
@@ -58,6 +62,34 @@ usage : |-
5862
https_port = 443
5963
listener_type = "forward"
6064
target_group_port = 80
65+
66+
http_tcp_listeners = [
67+
{
68+
port = 80
69+
protocol = "TCP"
70+
target_group_index = 0
71+
},
72+
{
73+
port = 81
74+
protocol = "TCP"
75+
target_group_index = 0
76+
},
77+
]
78+
https_listeners = [
79+
{
80+
port = 443
81+
protocol = "TLS"
82+
target_group_index = 0
83+
certificate_arn = module.acm.arn
84+
},
85+
{
86+
port = 84
87+
protocol = "TLS"
88+
target_group_index = 0
89+
certificate_arn = module.acm.arn
90+
},
91+
]
92+
6193
target_groups = [
6294
{
6395
backend_protocol = "HTTP"
@@ -77,17 +109,24 @@ usage : |-
77109
}
78110
}
79111
]
80-
}
112+
113+
extra_ssl_certs = [
114+
{
115+
https_listener_index = 0
116+
certificate_arn = module.acm.arn
117+
}
118+
]
119+
}
81120
```
82121
83122
### NLB Example
84123
```hcl
85124
module "nlb" {
86125
source = "clouddrove/alb/aws"
87126
version = "1.4.0"
88-
name = "nlb"
127+
name = local.name
89128
enable = true
90-
internal = true
129+
internal = false
91130
load_balancer_type = "network"
92131
instance_count = module.ec2.instance_count
93132
subnets = module.public_subnets.public_subnet_id
@@ -101,6 +140,11 @@ usage : |-
101140
protocol = "TCP"
102141
target_group_index = 0
103142
},
143+
{
144+
port = 81
145+
protocol = "TCP"
146+
target_group_index = 0
147+
},
104148
]
105149
target_groups = [
106150
{
@@ -109,11 +153,26 @@ usage : |-
109153
target_type = "instance"
110154
},
111155
{
112-
backend_protocol = "TLS"
113-
backend_port = 443
156+
backend_protocol = "TCP"
157+
backend_port = 81
114158
target_type = "instance"
115159
},
116160
]
161+
162+
https_listeners = [
163+
{
164+
port = 443
165+
protocol = "TLS"
166+
target_group_index = 0
167+
certificate_arn = module.acm.arn
168+
},
169+
{
170+
port = 84
171+
protocol = "TLS"
172+
target_group_index = 0
173+
certificate_arn = module.acm.arn
174+
},
175+
]
117176
}
118177
```
119178
@@ -122,34 +181,35 @@ usage : |-
122181
module "clb" {
123182
source = "clouddrove/alb/aws"
124183
version = "1.4.0"
125-
name = "clb"
126-
load_balancer_type = "classic"
127-
clb_enable = true
128-
internal = true
129-
target_id = module.ec2.instance_id
130-
security_groups = [module.ssh.security_group_ids, module.http_https.security_group_ids]
131-
subnets = module.public_subnets.public_subnet_id
132-
with_target_group = true
184+
185+
name = local.name
186+
load_balancer_type = "classic"
187+
clb_enable = true
188+
internal = true
189+
vpc_id = module.vpc.vpc_id
190+
target_id = module.ec2.instance_id
191+
subnets = module.public_subnets.public_subnet_id
192+
with_target_group = true
133193
listeners = [
134194
{
135-
lb_port = 22000
136-
lb_protocol = "TCP"
137-
instance_port = 22000
138-
instance_protocol = "TCP"
139-
ssl_certificate_id = null
195+
lb_port = 22000
196+
lb_protocol = "TCP"
197+
instance_port = 22000
198+
instance_protocol = "TCP"
199+
ssl_certificate_id = null
140200
},
141201
{
142-
lb_port = 4444
143-
lb_protocol = "TCP"
144-
instance_port = 4444
145-
instance_protocol = "TCP"
146-
ssl_certificate_id = null
202+
lb_port = 4444
203+
lb_protocol = "TCP"
204+
instance_port = 4444
205+
instance_protocol = "TCP"
206+
ssl_certificate_id = null
147207
}
148208
]
149209
health_check_target = "TCP:4444"
150210
health_check_timeout = 10
151211
health_check_interval = 30
152212
health_check_unhealthy_threshold = 5
153213
health_check_healthy_threshold = 5
154-
}
214+
}
155215
```

0 commit comments

Comments
 (0)