Skip to content

Commit 048b859

Browse files
authored
Feat/issue 233 (#49)
1 parent a424e12 commit 048b859

File tree

20 files changed

+589
-590
lines changed

20 files changed

+589
-590
lines changed

.deepsource.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
version = 1
2-
32
[[analyzers]]
4-
name = "terraform"
3+
name = "terraform"

.github/dependabot.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
# package ecosystems to update and where the package manifests are located.
33
# Please see the documentation for all configuration options:
44
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5-
65
version: 2
76
updates:
8-
97
- package-ecosystem: "github-actions"
108
directory: "/"
119
schedule:
@@ -43,7 +41,7 @@ updates:
4341
open-pull-requests-limit: 3
4442

4543
- package-ecosystem: "terraform" # See documentation for possible values
46-
directory: "/_example/public-private-subnet-endpoint" # Location of package manifests
44+
directory: "/_example/complete" # Location of package manifests
4745
schedule:
4846
interval: "weekly"
4947
# Add assignees
@@ -69,7 +67,7 @@ updates:
6967
open-pull-requests-limit: 3
7068

7169
- package-ecosystem: "terraform" # See documentation for possible values
72-
directory: "/_example/public-private-subnet" # Location of package manifests
70+
directory: "/_example/basic" # Location of package manifests
7371
schedule:
7472
interval: "weekly"
7573
# Add assignees
@@ -92,4 +90,5 @@ updates:
9290
reviewers:
9391
- "approvers"
9492
# Allow up to 3 open pull requests for pip dependencies
95-
open-pull-requests-limit: 3
93+
open-pull-requests-limit: 3
94+
Lines changed: 2 additions & 4 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:
9-
assign-pr:
7+
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/changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- "*"
77
workflow_dispatch:
88
jobs:
9-
call-workflow-changelog:
9+
changelog:
1010
uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@master
1111
secrets: inherit
1212
with:

.github/workflows/readme.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ on:
33
push:
44
branches:
55
- master
6-
76
jobs:
8-
readme-create:
7+
readme:
98
name: 'readme-create'
109
runs-on: ubuntu-latest
1110
steps:
@@ -40,7 +39,7 @@ jobs:
4039
with:
4140
actions_subcommand: 'push'
4241
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4443

4544
- name: 'Slack Notification'
4645
uses: clouddrove/action-slack@v2

.github/workflows/tf-checks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ jobs:
1212
tf-checks-basic-example:
1313
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
1414
with:
15-
working_directory: './_example/public-private-subnet-endpoint/'
15+
working_directory: './_example/basic/'
1616
tf-checks-public-private-subnet-single-nat-gateway-example:
1717
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
1818
with:
1919
working_directory: './_example/public-private-subnet-single-nat-gateway/'
20-
tf-checks-public-private-subnet-example:
20+
tf-checks-complete-example:
2121
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
2222
with:
23-
working_directory: './_example/public-private-subnet/'
23+
working_directory: './_example/complete/'
2424
tf-checks-public-subnet-example:
2525
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
2626
with:

.github/workflows/tflint.yml

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

README.yaml

Lines changed: 21 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66

77
# Name of this project
8-
name: Terraform AWS Subnet
8+
name : Terraform AWS Subnet
99

1010
# License of this project
1111
license: "APACHE"
@@ -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.4.6
30+
url: https://learn.hashicorp.com/terraform/getting-started/install.html
2831
# description of this project
2932
description: |-
3033
Terraform module to create public, private and public-private subnet with network acl, route table, Elastic IP, nat gateway, flow log.
@@ -40,97 +43,48 @@ usage: |-
4043
```hcl
4144
module "private-subnets" {
4245
source = "clouddrove/terraform-aws-subnet/aws"
43-
version = "1.3.0"
4446
name = "subnets"
4547
environment = "test"
46-
label_order = ["name", "environment"]
4748
nat_gateway_enabled = true
4849
availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
4950
vpc_id = module.vpc.vpc_id
5051
type = "private"
5152
cidr_block = module.vpc.vpc_cidr_block
5253
ipv6_cidr_block = module.vpc.ipv6_cidr_block
5354
public_subnet_ids = ["subnet-xxxxxxxxxxxx", "subnet-xxxxxxxxxxxx"]
54-
}
55+
}
5556
```
5657
5758
### PUBLIC-PRIVATE SUBNET
5859
```hcl
5960
module "subnets" {
60-
source = "clouddrove/terraform-aws-subnet/aws"
61-
version = "1.3.0"
62-
name = "subnets"
63-
environment = "test"
64-
label_order = ["name", "environment"]
65-
66-
nat_gateway_enabled = true
67-
availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
68-
vpc_id = module.vpc.vpc_id
69-
type = "public-private"
70-
igw_id = module.vpc.igw_id
71-
cidr_block = module.vpc.vpc_cidr_block
72-
ipv6_cidr_block = module.vpc.ipv6_cidr_block
73-
assign_ipv6_address_on_creation = false
74-
}
75-
```
76-
77-
### PUBLIC-PRIVATE SUBNET WITH SINGLE NET GATEWAY
78-
```hcl
79-
module "subnets" {
80-
source = "clouddrove/terraform-aws-subnet/aws"
81-
version = "1.3.0"
82-
name = "subnets"
83-
environment = "test"
84-
label_order = ["name", "environment"]
85-
availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
86-
nat_gateway_enabled = true
87-
single_nat_gateway = true
88-
vpc_id = module.vpc.vpc_id
89-
type = "public-private"
90-
igw_id = module.vpc.igw_id
91-
cidr_block = module.vpc.vpc_cidr_block
92-
ipv6_cidr_block = module.vpc.ipv6_cidr_block
93-
assign_ipv6_address_on_creation = false
61+
source = "clouddrove/terraform-aws-subnet/aws"
62+
name = "subnets"
63+
environment = "test"
64+
label_order = ["name", "environment"]
65+
nat_gateway_enabled = true
66+
availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
67+
vpc_id = module.vpc.vpc_id
68+
type = "public-private"
69+
igw_id = module.vpc.igw_id
70+
cidr_block = module.vpc.vpc_cidr_block
71+
ipv6_cidr_block = module.vpc.ipv6_cidr_block
72+
enable_ipv6 = true
9473
}
9574
```
9675
9776
### PUBLIC SUBNET
9877
```hcl
9978
module "subnets" {
10079
source = "clouddrove/terraform-aws-subnet/aws"
101-
version = "1.3.0"
10280
name = "subnets"
10381
environment = "test"
10482
label_order = ["name", "environment"]
105-
availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
83+
availability_zones = ["us-east-1a", "us-east-1b", "us-east-1c"]
10684
vpc_id = module.vpc.vpc_id
10785
type = "public"
10886
igw_id = module.vpc.igw_id
109-
cidr_block = module.vpc.vpc_cidr_block
110-
ipv6_cidr_block = module.vpc.ipv6_cidr_block
111-
assign_ipv6_address_on_creation = false
112-
87+
ipv4_public_cidrs = ["10.0.1.0/24", "10.0.13.0/24", "10.0.18.0/24"]
88+
enable_ipv6 = false
11389
}
114-
```
115-
116-
### PUBLIC-PRIVATE-SUBNET-ENDPOINT
117-
```hcl
118-
module "subnets" {
119-
source = "clouddrove/terraform-aws-subnet/aws"
120-
version = "1.3.0"
121-
name = "subnets"
122-
environment = "prashant"
123-
label_order = ["name", "environment"]
124-
125-
nat_gateway_enabled = true
126-
availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
127-
vpc_id = module.vpc.vpc_id
128-
type = "public-private"
129-
igw_id = module.vpc.igw_id
130-
cidr_block = module.vpc.vpc_cidr_block
131-
ipv6_cidr_block = module.vpc.ipv6_cidr_block
132-
assign_ipv6_address_on_creation = false
133-
enable_vpc_endpoint = true
134-
service_name = "com.amazonaws.${data.aws_region.current.name}.ec2"
135-
}
136-
```
90+
```

_example/basic/example.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
##-----------------------------------------------------------------------------
2+
## Subnet Module Call.
3+
## Both private and public subnet will be deployed.
4+
##-----------------------------------------------------------------------------
5+
#tfsec:ignore:aws-ec2-no-excessive-port-access
6+
#tfsec:ignore:aws-ec2-no-public-ingress-acl
7+
module "subnets" {
8+
source = "./../../"
9+
name = "subnets"
10+
environment = "test"
11+
nat_gateway_enabled = true
12+
availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
13+
vpc_id = "vpv_id-------"
14+
type = "public-private"
15+
igw_id = "vpc_igw_id---"
16+
cidr_block = "10.0.0.0/16"
17+
enable_ipv6 = false
18+
}
File renamed without changes.

0 commit comments

Comments
 (0)