> For the complete documentation index, see [llms.txt](https://bhushans-devops-organization.gitbook.io/aws-devops/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bhushans-devops-organization.gitbook.io/aws-devops/aws-codedeploy-or-pipeline-or-setup-or-deploy-application-on-ec2-using-s3-as-source.md).

# AWS CodeDeploy | Pipeline | Setup | Deploy application on EC2 using S3 as source

AWS Code Deploy: AWS CodeDeploy is a fully managed deployment service that automates software deployments to a variety of compute services such as Amazon EC2, AWS Fargate, AWS Lambda, and your on-premises servers. CodeDeploy makes it easier for you to rapidly release new features, helps you avoid downtime during application deployment, and handles the complexity of updating your applications.

Centralized control - AWS CodeDeploy allows you to easily launch and track the status of your application deployments through AWS management console

Minimize downtime - AWS CodeDeploy helps maximize your application availability during the software deployment process.

<figure><img src="/files/AUirJfeSpF5mLQX1EII7" alt=""><figcaption></figcaption></figure>

Create a S3 Bucket&#x20;

<figure><img src="/files/1HYmarwGDWcoU3fCZGbh" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Rmitagd0038QJTQufzGq" alt=""><figcaption></figcaption></figure>

Create a role

<figure><img src="/files/Y61QPLSIPV80S8t2d7Rb" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/hQ3diAdz3sI032vq48vp" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/W1GasQI5k03bJVpQt2hu" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Iv8sCBAdJLXsYILDwuLn" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/HqVGCfP9FWohm7bUH8dJ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/D4Rl0l2SXzlEyQ6N1Wkk" alt=""><figcaption></figcaption></figure>

code deploy role&#x20;

<figure><img src="/files/zIX0Hm6Uxbt2t6MJYxAh" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/96brumkFe7zFiHnOpCGb" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/cQSxgsG7Gk5ymoYZhblO" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/56ITSnaOeCvQXFOg7HOb" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/1pkSAwDPhSVqB6uJaF8M" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/0LMChPhUHQT9JKKLTFyh" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/2uDPBBTGULn7795mQxyk" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/IG1xNBUa18JFivc6UwyC" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/CN8Pp3PyWZ2buytBNGeA" alt=""><figcaption></figcaption></figure>

```
#!/bin/bash
sudo yum -y update
sudo yum -y install ruby
sudo yum -y install wget
cd /home/ec2-user
wget https://aws-codedeploy-us-east-2.s3.us-east-2.amazonaws.com/latest/install
sudo chmod +x ./install
sudo ./install auto
sudo yum install -y python-pip
sudo pip install awscli
```

<figure><img src="/files/DC6JD02PPnmN1vwoZLY5" alt=""><figcaption></figcaption></figure>

Code Deploy -&#x20;

Create a Application

<figure><img src="/files/xOYM7eP47juVKWH8GMN4" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/tzSJ6In02PGFpkfgJYIf" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/WDGBgxXYfd7YMlmvs3M3" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/8f06n7PB7GfqpPc9lJXl" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/qtC3hSUMLIygG6kBXoE7" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/aNrISSJSC3PBvGyP2jfH" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Q1Jv0DueFq1pGAYjtoQz" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/cXyrd3CvHqfgwOnFje0X" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/QfPMy9K0hkvh1EU7W4Mb" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/VjhEIy7vLgFv5ezpXNQN" alt=""><figcaption></figcaption></figure>

Application file link  download -

```
curl -O http://s3.amazonaws.com/aws-codedeploy-us-east-1/samples/latest/SampleApp_Linux.zip
```

<figure><img src="/files/jnRl8dazvDPuMKkIbTCP" alt=""><figcaption></figcaption></figure>

upload the Application folder on the S3

<figure><img src="/files/4fPQDiPHoCzG2XxPZfw4" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/JdbSp0GLX0H1AHXA5hzA" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/R4wZVsQNIQsMtdlohyVz" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/LWvBnYc90e0v80sfch6i" alt=""><figcaption></figcaption></figure>

### Creating a Pipeline&#x20;

<figure><img src="/files/4YJqkMyJ08AGh8Xgels0" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/FFWWgIJpB9LUXiWg8Auq" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Ohy3AAybC6b6DkjVIQ8o" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/XKz8lruGbSXBA4CBEAXn" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Jkepg5m58s26tHW0o2oV" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/nRftgtMCBmaZ0gvIUSvt" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/pxVzupryIToRfi6UiFQI" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/joJVRvc8rOWi0BHKja1k" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/FPH4f1obsIpo4p1sMgrQ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/bvMqq9vxKA4kmJf62US2" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/FRnOzw9Ef6x4tr5dvMt9" alt=""><figcaption></figcaption></figure>
