55#
66
77# Name of this project
8- name : Terraform AWS Subnet
8+ name : Terraform AWS Subnet
99
1010# License of this project
1111license : " 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
2932description : |-
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+ ```
0 commit comments