Skip to content

Using Terraform to deploy a basic architecture for ec2 instances running apache services.

Notifications You must be signed in to change notification settings

martinljor/AWS-EC2-Basic-Arc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS-EC2-Basic-Arc

Using Terraform to deploy a basic architecture for ec2 instances running apache services.

Architecture

The principal idea is to Work with Terraform and AWS to build this diagram: AWS-ec2-basic-arc

Deploy the Code & Infrastructure

The procedure to deploy the infrastructure and the code need the following code:

Go to the environment, for this example i am using "AWS-EC2-Basic-ARC":

$ cd terraform/
$ git clone https://github.com/tinchom/AWS-EC2-Basic-Arc.git
$ cd terraform/AWS-EC2-Basic-Arc
  • Initialised Terraform
$ terraform init
  • Validate the configuration
$ terraform validate
  • Execute the terraform plan (its going to ask you for key and secret)
$ terraform plan -out AWS-EC2-Basic-ARC.plan
  • Apply the terraform plan
$ terraform apply "AWS-EC2-Basic-ARC"

If everything went right, you can view the architecture deployed on your account.

Files descriptions

  • vpc.tf: This file contain the creation of VPC, Subnet, Internet GW, NAT GW, Route tables, Subnet Associations and Elastic IPs resources.
  • sg.tf: This file contain the creation of Security Groups resources required for EFS connection.
  • ec2.tf: This file contain the creation of EC2 resources/instances.
  • vars.tf: This file contains the variables and values of access keys, secret key, subnet settings and availabilty zones. For this case is set to us-east-1a and us-east-1b.

Results

If all went well you will have 2 instances running in public and private subnets. The private will access to HTTP services running EC2 public instance.

About

Using Terraform to deploy a basic architecture for ec2 instances running apache services.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages