Deploying Sample WordPress Application Using CodeDeploy

Lab Details

  1. This lab walks you through how to deploy sample WordPress applications with AWS CodeDeploy on Amazon EC2 Instance.

  2. Duration: 90 minutes

  3. AWS Region: US East (N. Virginia) us-east-1

Introduction

What is AWS CodeDeploy?

  • AWS CodeDeploy helps you automate your application deployment of a variety of compute services such as Amazon EC2, AWS Lambda, AWS Fargate, and on-premise servers.

  • Using CodeDeploy, We can deploy the following types of content:

    • Code

    • Serverless AWS Lambda functions

    • Web and configuration files

    • Executables Packages

    • Scripts

    • Multimedia files

  • The source code of the application can be stored in S3 Bucket, CodeCommit, git-based repositories such as GitHub or BitBucket.

  • Codedeploy makes helps you in rapidly releasing new features, Updating AWS Lambda functions version, To avoid downtime during application deployments, and handle the complexity of applications having error-prone manual deployments.

  • To work with various systems for configuration management, source control, continuous integration (CI), and continuous delivery, you can use CodeDeploy.

  • CodeDeploy can be used for the following types of deployment:

    • An application that requires servers like Amazon EC2, On-premise server

    • Applications are which are serverless, using AWS Lambda

    • Containerized applications deployed on Amazon ECS

  • AWS CodeDeploy supports two types of deployment:

    • In-place deployment: For this method, you stop the deployment of applications present on every instance and install a revised application. Once the newer version of the application is deployed the application starts and gets validated. 

      • Note: AWS Lambda and Amazon ECS deployments, do not support in-place deployments.

    • Blue-green deployment: For this deployment type, the characteristics of deployment depend on the type of compute platform used for deployment.

      • EC2 or On-premise platform

      • AWS Lambda

      • Amazon ECS

Architecture Diagram

Task Details

  1. Launching Lab Environment

  2. Launching an EC2 Instance

  3. SSH into EC2 Instance

  4. Install AWS CLI, Git version control, and CodeDeploy Agent

  5. Clone the application and copy application files from S3 Bucket

  6. Create a CodeDeploy application and push the bundled application to S3 Bucket

  7. Create a Deployment Group

  8. Create a deployment and deploy the application on the instance

  9. Test the application using EC2 Instance Public IPv4 DNS

  10. Setup the WordPress site

  11. Access the WordPress site

  12. Validation of the lab

  13. Delete the CodeDeploy application