Skip to content

Commit 223a4ca

Browse files
Merge pull request #2 from source4learn/mr-alpha
Readme Update
2 parents 1f0feac + 2679513 commit 223a4ca

File tree

2 files changed

+69
-7
lines changed

2 files changed

+69
-7
lines changed

README.md

Lines changed: 69 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Hashicorp Terraform AWS VPC Module
2-
Terraform AWS VPC Module by Source4Learn(An Opensource Community to learn and share knowledge)
3-
![Source4Learn](https://github.com/opensource4learn/terraform-aws-vpc/blob/main/s4l.png?raw=true)
2+
Terraform AWS VPC Module by Source4Learn(Source4Learn is an opensource learning community.)
3+
![Source4Learn](https://github.com/source4learn/terraform-aws-vpc/blob/main/s4l.png?raw=true)
44

55
## AWS VPC Module
6-
This AWS VPC Module will create following resources:
7-
- Subnets ["Public", "Private", "Storage"]
8-
- Route Tables ["Public", "Private", "Storage"]
6+
This AWS Terraform module is designed to implement the common AWS infrastructure patterns such as single or multi-tier. The multi-tier patterns allow users to create infrastructure in separate layers as per the needs of modern applications.
7+
8+
AWS VPC Module will create following resources:
9+
- VPC and Subnets
10+
- Route Tables
911
- Security Gruoups
1012
- Internet Gateway
1113
- NAT Gateway
@@ -21,8 +23,8 @@ provider "aws" {
2123
}
2224
2325
module "vpc" {
24-
source = "opensource4learn/vpc/aws"
25-
version = "0.1.0-beta"
26+
source = "source4learn/vpc/aws"
27+
version = "0.1.1"
2628
cluster_prefix = "source4learn"
2729
cluster_environment = "development"
2830
cluster_architecture = "3-tier"
@@ -31,6 +33,55 @@ module "vpc" {
3133
}
3234
```
3335

36+
# AWS Multi Layer Architecture
37+
The AWS resources created in the public layers can be accessed publicly(i.e. - frontend servers, load-balancers, bastion instances, etc) but backed resources such as application servers, databases, caching servers will remain in private sections.
38+
39+
The AWS infrastructure patterns can be categories as follows:
40+
41+
- **Public Layer:** This layer consists of public subnets and has one subnet on each availability zone for high availability.
42+
- **Application Layer:** This layer of AWS infrastructure contains the private subnets and one on each Availability Zone.
43+
- **Database Layer:** The third layer consists of 3 private subnets and the same subnet on each availability zone.
44+
45+
Let's take a brief overview of multi-layers or multi-tier architecture. It divides the AWS infrastructure into layers like - Public, Private, and Storage(Isolated database) layers. The reason behind this implementation is to protect and isolate private layers from any unwanted public access. In other words, the Public layer provides a shield to internal layers of architecture.
46+
47+
To split the AWS infrastructure into multiple tiers and availability zones, please refer to below architectural diagram:</br>
48+
![VPC](https://github.com/source4learn/terraform-aws-vpc/blob/main/vpc.png?raw=true)
49+
50+
AWS allows users to create the multi-tier infrastructure and distribute it across the availability zones of the current region to achieve the high availability of resources.
51+
52+
## 3-tier architecture
53+
A three-tier architecture pattern help will help to design a highly secured, modular, scalable, and fault-tolerant infrastructure. In this approach, the application infrastructure will be divided into a public layer, business logic, and storage layer. The resources in the individual layer are being created separately and they can communicate with specific pre-defined routes and security rules.
54+
55+
Use this approach while implementing a microservices-based application architecture. The internet-facing services like - Frontend servers and bastion instances can be created public layer, app servers can be created in the intermediate application layer, and storage layer can have data services such as databases/caching etc.
56+
57+
This AWS Terraform module will help you to create an AWS VPC with 3-tier by just passing `cluster_architecture` as `3-tier`. Users also need to define the desired VPC size in form of `cidr` and subnet mask as `subnet_bits`.
58+
59+
*Example:* Let's assume that the user needs to create a VPC network with ~4000 hosts available and each subnet should have 254 IP addresses. So the cidr value for vpc would be `x.x.x.x/20` and the expected value for subnet would be `x.x.x.x/24`. But in this Terraform module, it accepts subnet mask value as subnet bits which can be calculated by subtracting the subnet cidr value with vpc cidr value.
60+
61+
```
62+
cluster_architecture = "3-tier"
63+
cidr = "10.0.0.0/20"
64+
subnet_bits = "4"
65+
```
66+
67+
## 2-tier architecture
68+
The two-tier pattern is suitable for that application architecture which requires the isolation between the presentation and business logic without increasing the complexity of application infrastructure.
69+
70+
```
71+
cluster_architecture = "2-tier"
72+
cidr = "10.0.0.0/20"
73+
subnet_bits = "4"
74+
```
75+
76+
## 1-tier architecture
77+
This single tier architecture can be used for monolythic infrastructures(Highly in-secure) and test/devlopment environments.
78+
79+
```
80+
cluster_architecture = "1-tier"
81+
cidr = "10.0.0.0/20"
82+
subnet_bits = "4"
83+
```
84+
3485
## Requirements
3586

3687
| Name | Version |
@@ -74,3 +125,14 @@ module "vpc" {
74125
| Name | Description |
75126
|------|-------------|
76127
| <a name="output_vpc_id"></a> [vpc\_id](#output\_vpc\_id) | Terraform Output |
128+
129+
## Summary
130+
131+
If you encounter an error or problem in this setup, please report in the GitHub repository issues.</br>
132+
Reach us in case you need any further assistance.
133+
134+
Email: source4learn@gmail.com
135+
136+
Twitter: ![@source4learn](https://twitter.com/source4learn/)
137+
138+
LinkedIn: ![linkedin.com/in/source4learn](https://www.linkedin.com/in/source4learn/)

vpc.png

112 KB
Loading

0 commit comments

Comments
 (0)