File contains information necessary to authorize to AWS.
File is working with tfswitch. is responsible for switching terraform to the version required by the script.
File contains global variables with default values used by the script.
File contains values for global variables.
Files contain global variables values for the particular environment.
File collects modules used for building infrastructure.
File contains information to display after infrastructure is provisioned.
Folder contains modules. Every module is stored in separate subfolder named from module name.
Every module subfolder contains file main.tf with module definition, file variables.tf
that contains variables specific for this module and file output.tf which contains informations returned from the module.
- Creating a VPC with CIDR Block and enable DNS Hostnames to assign DNS names to instances.
- Creating subnets
- public
- private
- Creating an internet gateway for connecting VPC/Network with the internet and also attach gateway to VPC.
- Creating a route table and create route for internet gateway so that instance can connect to the internet
- Associate public subnet with newly created route table.
- Creating an Elastic IP for the NAT Gateway.
- Creating a NAT gateway and allocate the elastic IP to it and put it in public subnet.
- Adding route to NAT gateway to the default (private) route table created along VPC to let resources from private subnet access to the internet.
- Creating WebDMZ security group allowing communication from / to the internet
- Creating Key Pair for EC2 instance
- Creating EC2 instance, attach it to the public security group in the public subnet
- Creating two EC2 instance, attach it to the private security group in the private subnet