Skip to content

Haneefh/nginx-aws

Repository files navigation

Automated Nginx setup on AWS using Docker

Project Summary

This builds an AWS Infrastructure with networking and compute instance using terraform. Ansible is integrated to deploy a nginx docker container on the instance

Requirements

Terraform version 1 or above
Ansible version 2.9 or above
Community Docker installed (can be done using below command)

ansible-galaxy collection install community.docker

Providers

Name Version
aws 4.19.0
http 2.2.0

Usage

  1. Clone the github repository
  2. Change terraform.tfvars.example to terraform.tfvars and provide the variable values.
  3. Run the below to initialize terraform
    terraform init
  4. Run a plan followed by an apply
    terraform plan 
    terraform apply

Resources

Name Type
aws_instance.awsvm resource
aws_internet_gateway.gw resource
aws_key_pair.ec2_key resource
aws_network_acl.nacl resource
aws_route.default_rt resource
aws_route_table.public_rt resource
aws_route_table_association.public_assoc resource
aws_security_group.allow_http_ssh resource
aws_subnet.pubsubnet resource
aws_vpc.main resource
aws_ami.ec2-ami data source
http_http.my_public_ip data source

Inputs

Name Description Type Default Required
aws_region n/a string "us-east-1" no
dns_hostnames n/a bool true no
instance_tenancy n/a string "default" no
instance_type Ec2 instance type string "t2.small" no
key_name n/a any n/a yes
name Name of the resource any n/a yes
private_key_path n/a any n/a yes
public_key_path n/a any n/a yes
ssh_user n/a string "ubuntu" no
vpc_cidr Enter a cidr block in /16 subnet string "10.0.0.0/16" no

Outputs

Name Description
ec2_public_ip PUBLIC IP
vpc_id VPC ID

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages