Skip to content

CloudFormation to deploy and host high available private applications

License

Notifications You must be signed in to change notification settings

lvthillo/aws-private-ha-app-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

aws-private-ha-app-setup

This template will deploy a VPC which contains two public subnets (using an Internet Gateway) and two private subnets. There are also two EC2 applications created which are hosted in private subnets in different Availability Zones (HA). The EC2's will check when the NAT Gateway is working and install + host an Apache server. There EC2s were able to download the httpd package from the internet by using that NAT Gateway. Also an additional EC2 is created in a public subnet (public IP) to make this EC2 reachable from the internet. This EC2 will serve as bastion host. It is possible to SSH inside the bastion host and connect from there to the private EC2 instances which are hosting the basic website.

Prerequisites

  • Create a key pair on AWS and define this key pair in your parameters.json
  • Define parameters in parameters.json

Create stack

Create stack using AWS CLI:

$ aws cloudformation create-stack --stack-name vpc-demo --template-body file://template.yaml --parameters file://parameters.json 

Diagram

foto1

Resources

Resources created in initial ChangeSet: screen shot 2018-11-13 at 18 43 12

Test application environment

blur1

  • Test LB by turning of an EC2 instance.
  • SSH to Bastion Host
$ ssh-add -K demo-key.pem
Identity added: demo-key.pem (demo-key.pem)
# SSH to Public IP of bastion host
$ ssh -A [email protected] 
  • SSH from inside Bastion Host to private application instances
# SSH from Bastion host to private instances
$ ssh [email protected]
$ exit
$ ssh [email protected]
$ exit

About

CloudFormation to deploy and host high available private applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published