|
1 | 1 | # Hashicorp Terraform AWS VPC Module
|
2 |
| -Terraform AWS VPC Module by Source4Learn(An Opensource Community to learn and share knowledge) |
3 |
| - |
| 2 | +Terraform AWS VPC Module by Source4Learn(Source4Learn is an opensource learning community.) |
| 3 | + |
4 | 4 |
|
5 | 5 | ## AWS VPC Module
|
6 |
| -This 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. |
| 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 | 7 |
|
8 | 8 | AWS VPC Module will create following resources:
|
9 | 9 | - VPC and Subnets
|
@@ -33,29 +33,54 @@ module "vpc" {
|
33 | 33 | }
|
34 | 34 | ```
|
35 | 35 |
|
36 |
| -# AWS VPC multi-tier 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, database, caching servers will remain in private sections. The AWS infrastructure patterns can be categories as follows: |
| 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 | 38 |
|
| 39 | +The AWS infrastructure patterns can be categories as follows: |
39 | 40 |
|
40 | 41 | - **Public Layer:** This layer consists of public subnets and has one subnet on each availability zone for high availability.
|
41 | 42 | - **Application Layer:** This layer of AWS infrastructure contains the private subnets and one on each Availability Zone.
|
42 | 43 | - **Database Layer:** The third layer consists of 3 private subnets and the same subnet on each availability zone.
|
43 | 44 |
|
44 |
| -Let's take a brief overview of multi-layers or multi-tier architecture. It basically 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. |
| 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. |
45 | 46 |
|
46 | 47 | To split the AWS infrastructure into multiple tiers and availability zones, please refer to below architectural diagram:</br>
|
47 | 48 | 
|
48 | 49 |
|
49 |
| -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. |
| 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. |
50 | 51 |
|
51 | 52 | ## 3-tier architecture
|
52 |
| -**Information yet to be added. |
| 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 | +``` |
53 | 66 |
|
54 | 67 | ## 2-tier architecture
|
55 |
| -**Information yet to be added. |
| 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 | +``` |
56 | 75 |
|
57 | 76 | ## 1-tier architecture
|
58 |
| -**Information yet to be added. |
| 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 | +``` |
59 | 84 |
|
60 | 85 | ## Requirements
|
61 | 86 |
|
@@ -100,3 +125,14 @@ AWS allows users to create the multi-tier infrastructure and distribute it acros
|
100 | 125 | | Name | Description |
|
101 | 126 | |------|-------------|
|
102 | 127 | | <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:  |
| 137 | + |
| 138 | +LinkedIn:  |
0 commit comments