This repository is created for Udagram Applicaiton.
I created 2 scripts for creating infrastructure and required servers for application in order to avoid a long script.
As first and foremost, I created 2 key files from AWS Console.
jumpbox-key.pem
for bastion host/jumpboxprivate-devops-key.pem
for private servers
Use this script udagram-infra.yml to create required VPCs, Subnets, Internet Gateway, Routing tables, etc..
cd udagram-cloudformation-script
create.sh udagraminfra udagram-infra.yml udagram-infra-params.json
Use this script udagram-server.yml to create as following -
- Load Balancer
- Security Groups
- Deploying instances by load balancer using LaunchConfiguration
- Creating AMI Role to access S3 bucket
- Creating Instance profile and attach to instances
- Creating Bastion host to access to private servers
- etc..
create.sh udagram udagram-server.yml udagram-server-params.json
Udagram application is deployed as following screenshot.
In the outputs, you will see LoadBalancerDNS is concatenated with http://
.
http://udagr-WebAp-10KNR64ZJYD7V-250719208.us-east-1.elb.amazonaws.com
Load Balancer Screenshot
Browsing DNS
Jumpbox is created with specific Security Group which allow to my home IP address.
PS: In this case, I assumed we created development servers(EC2 Instances) with
private-devops-key.pem
. After testing all of following flows, I updated to Launch Configuration by removingkeyName: private-devops-key
fromudagram-server.yml
script, in order to prevent ssh to production servers.
create.sh jumpbox jumpbox.yml jumpbox-params.json
- Jumpbox is accessed via my home IP address
- Copy
private-devops-key.pem
into jumpbox
- Accessing to PrivateInstance1 from jumpbox(10.0.2.75)
- Accessing to PrivateInstance2 from jumpbox(10.0.2.80)
- Accessing to PrivateInstance3 from jumpbox(10.0.3.54)
Authored by: Marn111/2022