Create and Deploy Applications Using CodeDeploy and CodePipeline
Create and Deploy Applications Using CodeDeploy and CodePipeline
Home / AWS / Guided Lab / Create and Deploy applications using CodeDeploy and CodePipeline
Amazon EC2 Amazon S3 AWS CodeDeploy Amazon Web Services AWS CodePipeline
e 1h 8m 39s left
End Lab
Open Console
Validation
Lab Credentials
User Name x
Whiz_User_16857.53640216 w
Password x
0b9035fb-4100-4c4c-8eee-26ecea010562 w
Access Key x
AKIA5ZDWWD72UWOJJ2I7 w
Secret Key x
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 w
Lab Resources
Support Documents
Privacy - Terms
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 1/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
5. Understanding CodeDeploy
Need help?
Troubleshooting Lab
FAQs
Lab Steps
Task 1: Sign in to AWS Management Console
1. Click on the Open Console button, and you will get redirected to AWS Console in a
new browser tab.
Now copy your Username and Password in the Lab Console to the IAM
Username and Password in AWS Console and click on the Sign in button.
3. Once Signed In to the AWS Management Console, make the default AWS Region
as US East (N. Virginia) us-east-1.
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 2/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
Note: If you face any issues, please go through FAQs and Troubleshooting for Labs.
2. Navigate to EC2 by clicking on the Services menu in the top, then click on EC2 in the
Compute section.
3. Click on Instances from the left sidebar and then click on Launch Instances
5. For Amazon Machine Image (AMI): In Quick Start menu, Select Amazon Linux
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 3/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
To add SSH
Source: Anywhere
For HTTP,
Source: Anywhere
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 4/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
12. Launch Status: Your instance is now launching, Click on the instance ID and wait for
complete initialization of instance state till status change to Running
13. Note down the sample IPv4 Public IP Address of the EC2 instance. A sample is shown
in the screenshot below.
In this task, we are going to prepare the environment for deploying and managing
applications using AWS CodeDeploy
1. Switch to root user: This command switches the user to the root user. By switching to
the root user, you gain administrative privileges and can perform system-level tasks.
sudo su
w
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 5/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
2. Run the updates: This command updates the software packages installed on the EC2
instance to their latest versions. It ensures that the instance has the latest security
patches and bug fixes.
yum -y update
w
3. Install the CodeDeploy agent:
Install the prerequisite i.e., ruby and wget : This command installs the Ruby
programming language and the wget utility. Ruby is a prerequisite for installing
the CodeDeploy agent, and wget is used to download the agent's installer.
wget https://aws-codedeploy-us-east-1.s3.us-east-
1.amazonaws.com/latest/install
w
Change the permission of the installer : This command changes the permissions of the
installer script, making it executable. It allows the script to be run and installed on the
EC2 instance.
chmod +x ./install
w
Install the latest version of the CodeDeploy agent : This command runs the CodeDeploy
agent's installer script in auto mode. The auto mode automatically detects the
instance's operating system and installs the agent accordingly.
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 6/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
If the output says, “error: No AWS CodeDeploy agent running”, then start the agent by
running the below command and check the status again.
Start the agent: This command starts the CodeDeploy agent service. If the agent is not
running, this command starts it.
In this task, we are going to obtain the object key, which is required for configuring the source
stage in AWS CodePipeline.
1. Navigate to the Services menu at the top. Click on S3 in the Storage section.
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 7/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
4. Copy the object Key, and save it to notepad. We'll need this in further steps.
1. Navigate to CodeDeploy by clicking on the Services menu at the top, then click on
CodeDeploy in the Developer Tools section.
2. Click on the Applications present on the left sidebar under CodeDeploy option.
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 8/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
Enter a service role : Select the service role from the dropdown.
In Tag Group 1, use the following tags to select the EC2 Instance for
deployment:
Note: The value should be the same as the tag defined while creation of EC2
Instance.
Key: Name
Value: MyEC2Instance
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 9/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
1. Navigate to CodePipeline by clicking on the Services menu at the top, then click on
CodePipeline in the Developer Tools section.
2. Click on Pipelines from the left sidebar and then click on the Create pipeline
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 10/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 11/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 12/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 13/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 14/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
Task 8: Test the application using EC2 Instance Public IPv4 DNS
1. Navigate to EC2 by clicking on the Services menu in the top, then click on EC2 in
the Compute section.
3. To view the metadata of an EC2 Instance, click on the Instance ID for the instance
named MyEC2Instance.
5. Open the new tab in the browser and paste the public IP.
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 15/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
Do you Know?
AWS CodePipeline has announced the general availability of AWS CodePipeline for
Containers. This new feature allows developers to easily build, test, and deploy container
images to any container registry or Kubernetes cluster using CodePipeline.With
CodePipeline for Containers, developers can now use familiar container tools and
workflows to manage their CI/CD pipelines for containerized applications. They can
define the build and test stages of their pipeline using Dockerfiles and container images,
and then deploy those images to their container orchestration platform of choice, such
as Amazon Elastic Kubernetes Service (EKS) or Amazon Elastic Container Service (ECS).This
new feature provides developers with a more streamlined and efficient way to manage
their container deployments, making it easier to build and release containerized
applications with greater speed and agility.
1. Once the lab steps are completed, please click on the Validation button on the right
side panel.
2. This will validate the resources in the AWS account and displays whether you have
completed this lab successfully or not.
3. Sample output :
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 16/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
1. Navigate to CodeDeploy by clicking on the Services menu at the top, then click
on CodeDeploy in the Developer Tools section.
5. In the confirmation pop-up, type delete to complete the deletion of the application.
6. You have successfully tested the application using Public IPv4 DNS of the EC2
Instance.
End Lab
1. Sign out of AWS Account.
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 17/18
8/29/23, 8:28 PM Create and Deploy applications using CodeDeploy and CodePipeline
3. Once you have completed the steps, click on End Lab from your whizlabs dashboard.
https://www.whizlabs.com/labs/create-and-deploy-applications-using-codedeploy-and-codepipeline 18/18