Professional Documents
Culture Documents
Deployment Steps
Deployment Steps
Deployment Steps
# Do not change version. This is the version of aws buildspec, not the version of your buldspec file.
version: 0.2
phases:
install:
commands:
pre_build:
commands:
- npm install
build:
commands:
post_build:
commands:
# Include only the files required for your application to run.
# Do not use recursively include artifacts from node_modules directory as it will
include unnecessary packages
# used only for building and testing.
# ExpressJS apps will need other artifact directories included (bin/*, public/*,
routes/*, views/* etc).
artifacts:
files:
- app.js
- index.html
- package.json
1. Create IAM Role -> EC2 -> AmazonEC2RoleForAWSCodeDeploy -> Create role with the
desired role name.
2. Create EC2 -> deploy the following.
cd /home/ec2-user
wget https://bucket-name.s3.amazonaws.com/latest/install
chmod +x ./install
3. https://docs.aws.amazon.com/codedeploy/latest/userguide/codedeploy-agent-operations-
install-ubuntu.html
4. Bucket-name is the name of the aws region. (aws-codedeploy-ap-south-1)
5. Install and Configure HTTP Server
<VirtualHost *:80>
6. ProxyPreserveHost On
ProxyPass / http://127.0.0.1:5000/
Redirect
ProxyPassReverse / http://127.0.0.1:5000/
ErrorLog ${APACHE_LOG_DIR}helloapp-error.log
</VirtualHost>
6. Auto scaling group for the created ec2 instance.
IAM ROLES:
AMI:
1. Create a server, install the requirements, let’s encrypt, ruby,nginx,install the code deploy and
start the deployment service.