Load-Balanced MEAN-Stack by AWS CloudFormation & Docker 🐳
source link: https://dev.to/tgotwig/load-balanced-mean-stack-by-aws-cloudformation-docker-3pj9
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
🐳 MEAN-Stack CloudFormation (2 Part Series)
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 [email protected]: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 😎🎉
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK