AWS Code Deploy - CI/CD Series Part 3

 

AWS Code Deploy is a service provided by Amazon Web Services (AWS) that helps you automate software deployment on various types of computing resources such as EC2 instances, on-premises servers, or Lambda functions.

Appspec.yaml:

The AppSpec file is a YAML-formatted file used by AWS CodeDeploy to manage the deployment of an application.

It provides instructions to CodeDeploy about the application’s source code, the deployment target, the scripts to run, and the permissions required to execute the scripts.

It also includes information about the deployment lifecycle hooks, which allow developers to execute custom scripts at specific points during the deployment process.

Before we start with code deploy, We need to create a role which has the below permissions.


Once the role is created. Let's proceed to Code Build. Create an application.

Next, Create a deployment group for the application.

Give the deployment group name and role that we created and select the deployment type. I have chosen "InPlace" update.



In environment configuration, I am selecting "EC instance" by the name "demo". So, I should have an EC2 instance by the name "demo" with code deploy agent installed. Refer to this link for installing code deploy agent https://docs.aws.amazon.com/codedeploy/latest/userguide/codedeploy-agent-operations-install-ubuntu.html



Once the deployment group is created. Proceed with creating a deployment. 


Under deployment, select the deployment group. 


Enter the source where the build(artifacts) are available - S3. Give the bucket name and file extension.




Click on "Create Deployment" and "Start Deployment".


Our deployment is completed, which means our app is installed on the EC2 instance and we can test it by accessing the IP of the EC2 instance.



In the next post, We will Code PipeLine.








Comments

Popular posts from this blog

SRE/DevOps Syllabus

AWS Code Commit - CI/CD Series Part 1

Docker - Preventing IP overlapping