In this short article I will show how to deploy a Mean-Stack app by AWS-CLI and CloudFormation using a v1 load-balancer π
All the code regarding our deployment you can also find here:
https://github.com/TGotwig/devops
We take usage of an very nice and simple MEAN-Stack project which comes from Brad Traversy π€
Download the sample repo and cd into it:
git clone git@github.com:TGotwig/devops.git
cd aws-cloudformation/solutions/advanced/mean-stack
βοΈ Setup awscli
Install the awscli
from somewhere and login:
aws configure --profile <YOUR_AWS_ACCOUNT_NAME>
You will be asked for two IDs, you can get them through:
βοΈ Setup ssh
Create a file called parameters.json
:
[
{
"ParameterKey": "KeyName",
"ParameterValue": "<KeyName>"
}
]
Replace <KeyName>
by your SSH key under EC2 / Key Pairs
:
βοΈ Setup Makefile
Create a file called .env
for the Makefile
:
stack-name=simple-mean-stack
profile=<YOUR_AWS_ACCOUNT_NAME>
region=<YOUR_AWS_REGION>
π Run it!
Start it by running make up
, an EC2 machine should boot up:
After some time we can reach the app, run make getUrl
to get the url:
After refreshing the page few times you should see another IP:
You can remove the entire stack by running make rm
! π₯
Awesome! Now we have finished our load-balanced Mean-Stack app ππ
Top comments (0)