Setting Up CodePipeline for the Node.js Project
Learn to deploy the finalized Node.js application using CodePipeline.
Prerequisites
To deploy a Node.js
application, or any other type of application, we need to put some things in place. These include setting up our target infrastructure, assigning permissions as required, and then setting up the deployment pipeline.
Creating a tag and a security group
Note: Please use the terminal of the widget to execute all the commands. A bash file has also been provided for speedy execution.
- To create a tag, use the
create-tags
command as shown below:
Press + to interact
aws ec2 create-tags --resources ami-0c94855ba95c71c99 --tags Key=name,Value=nodeInstance --region us-east-1
You have been provided with the following parameters; feel free to change the specified values to your preference.
resources
: This is the ID for the AMI of your choice.ami-0c94855ba95c71c99
: This is the ID forAmazon Linux 2 AMI
.tags
: This is the key-value pair to identify your EC2 instance.
Note: The user running the
aws ec2 create-tags
command must have theCreateTags
permission assigned to them.
- To create a security group, use the
create-security-group
command as shown below:
Press + to interact
aws ec2 create-security-group --group-name my-sg --description "My security group" --region us-east-1
name
: This is the name of your security group.description
: This is the description of the security group.
Note: The user running the
aws ec2 create-security-group
...