Skip to content

Utilizes Terraform to deploy Amazon Web Services (AWS) Virtual Private Cloud (VPC) & Elastic Compute Cloud (EC2) instance, includes an nginx (HTTP) deployment

Notifications You must be signed in to change notification settings

alexlop00/Terraform_Example_AWS_Nginx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Terraform_Example_AWS_Nginx

Introduction

Purpose

This purpose of this repository is to provide a sample Terraform template for deploying an Amazon Web Services (AWS) Virtual Private Cloud (VPC) & Elastic Compute Cloud (EC2) instance, with an nginx (HTTP) deployment.

Intended Audience

The intended audience for this manual is cloud administrators. Configuring the virtual private cloud (VPC) relies heavily on local area network (LAN) and wide area network (WAN) concepts (e.g. subnetting, routing, server configuration). Familiarity with these concepts aids in understanding each section of the template.

NOTE: This manual assumes users are familiar with navigating Amazon Web Services (AWS) services and Terraform.

Scope

As per the scope of this script, the template deploys:

  • a Virtual Private Cloud (VPC)
    • CIDR Block: 192.168.4.0/24
    • Enabled DNS Support
  • a Subnet
    • CIDR Block: 192.168.4.0/26
  • an Internet Gateway
  • a Route Table & Route
    • Associates Route Table to Subnet
  • a Security Group
    • Enables HTTP Access
    • Allows all outbound requests
  • an EC2 Instance
    • Image: Ubuntu 20.04
    • Installs/Deploys Nginx server

This script does not allow SSH access, nor does it configure a key pair.

WARNING: This script assumes the user wants to deploy the resources in the "us-east-2" availability zone. Adjust according to your configuration; Adjustments indicated by "#ADJUST" comment wihin the script.

Disclaimers

This script is intended for demonstation purposes only. It does not provide best security practices.

  • The image is not hardened.
  • A direct route to the instance is not configured.
  • Security group contains open access.
  • The nginx software is not secured.

List of Materials and Equipment Needed

Users must configure these services prior to attempting to deploy the Terraform template:

  • Amazon Web Services (AWS) Account - An AWS account provides access to Amazon’s cloud services.
    • NOTE: This account must have the appropriate permissions to deploy a VPC & EC2 instance.
  • Amazon Web Services (AWS) Command-Line Utility (CLI) - The AWS CLI is a command-line utility designed to provide terminal access to AWS services.
  • Terraform Command-Line Utility (CLI) - The Terraform CLI is a command-line utility designed to provide terminal access to Terraform features.

WARNING: Both the AWS CLI & Terraform CLI must be configured prior to running the template. This includes configuring the AWS Access Key and Terraform Login.

Recommended Reading

Proof of Concept

Download the Terraform Template. Download Script

Initialize Terraform. Initialize Directory

Apply the Terraform Plan. Apply Terraform Plan

View the Nginx Deployment. View the Deployment

About

Utilizes Terraform to deploy Amazon Web Services (AWS) Virtual Private Cloud (VPC) & Elastic Compute Cloud (EC2) instance, includes an nginx (HTTP) deployment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages