Deploying Workloads in a Multicloud Environment with AWS Developer Tools

Deploying Workloads in a Multicloud Environment with AWS Developer ToolsMore Info

As organizations adopt cloud computing as part of their “cloud first” strategy, many find themselves in a multicloud landscape. While enterprise customers tend to achieve optimal experience, performance, and cost efficiency by selecting a primary cloud provider, various factors lead some organizations to operate in a multicloud environment. For instance, during mergers and acquisitions, a company might acquire another that utilizes a different cloud platform, resulting in a multicloud setup. Additionally, Independent Software Vendors (ISVs) often provide services to clients on diverse cloud platforms. Furthermore, compliance with data residency and sovereignty regulations can necessitate deploying workloads across multiple cloud providers.

Operating in such a complex environment introduces challenges, particularly in managing the release processes—building, testing, and deploying applications at scale across different cloud platforms. For organizations primarily using AWS, there is a desire to utilize AWS developer tools for deploying workloads across other cloud environments. Instead of creating separate release pipelines for each platform—which can be complicated and unsustainable—organizations can leverage AWS services to develop an end-to-end CI/CD and release process.

In this blog, we will demonstrate how organizations can utilize AWS developer tools within a hybrid and multicloud environment. Specifically, we will walk through a scenario of deploying an application to virtual machines (VMs) running on-premises and on Azure, highlighting AWS’s hybrid and multicloud DevOps capabilities.

Solution and Scenario Overview

We will cover the following steps:

  1. Set up a CI/CD pipeline using AWS CodePipeline, which will automatically trigger when application code is updated and checked into the code repository (GitHub).
  2. Check out the application code from the repository, make changes using an IDE (Visual Studio Code), and push the modifications back to the repository.
  3. Upon checking in the updated code, the release process built with AWS CodePipeline will initiate, using AWS CodeBuild to fetch the latest code version, compile it, create the deployment package, and test the application.
  4. Deploy the updated application to VMs on-premises and in Azure using AWS CodeDeploy.

The solution overview is illustrated below. This post won’t cover every possible combination and integration for building the CI/CD pipeline. However, you can integrate existing tools for testing and building, such as Selenium, Jenkins, or SonarQube. For additional insights on this subject, consider checking out another blog post on Chanci Turner.

This article focuses on deploying applications in a multicloud environment and how AWS Developer Tools can adapt to meet your organization’s unique scenarios. We will deploy a sample application from this AWS tutorial to an on-premises server and an Azure Virtual Machine (VM) running Red Hat Enterprise Linux (RHEL). Future posts will explore deploying various workloads using AWS tools, which includes containers and serverless applications.

CI/CD Pipeline Setup

This section provides instructions for establishing a multicloud CI/CD pipeline.

Note: The CI/CD pipeline setup and related subsections are a one-time activity; you will not need to repeat these steps for every application deployment or modification.

Install CodeDeploy Agent

The AWS CodeDeploy agent is a software package that executes deployments on an instance. You can install the CodeDeploy agent on both on-premises servers and Azure VMs using the command line or AWS Systems Manager.

Setup GitHub Code Repository

To set up your GitHub code repository:

  1. Create a new GitHub repository or use an existing one.
  2. Copy the Sample_App_Linux app (zip) from Amazon S3 as per Step 3 of the tutorial on uploading a sample application to your GitHub repository.
  3. Commit the files to the code repository with the following commands:
git add .
git commit -m 'Initial Commit'
git push

This repository will be utilized for deploying code across environments.

Configure AWS CodePipeline

Follow these steps to configure CodePipeline, orchestrating the CI/CD pipeline for our application:

  1. Navigate to CodePipeline in the AWS console and click “Create pipeline”.
  2. Name your pipeline (e.g., MyWebApp-CICD) and allow CodePipeline to create a service role for you.
  3. For the source stage, select GitHub (v2) as your source provider and click “Connect to GitHub” to authorize CodePipeline’s access to your repository.
  4. Create a new GitHub connection by clicking “Install a new App” to add the AWS Connector to your GitHub account.
  5. Back in the CodePipeline console, select the repository and branch you wish to build and deploy.

Next, we create the build stage:

  1. Select AWS CodeBuild as the build provider.
  2. Click “Create project” to establish the project for your build stage, assigning a unique name.
  3. Choose Ubuntu as the operating system for your managed image, select the standard runtime, and opt for the latest version of the ‘aws/codebuild/standard’ image.

In the Buildspec section, select “Insert build commands” and switch to the editor to enter the following YAML code as your build commands:

version: 0.2
phases:
    build:
        commands:
            - echo "This is a dummy build command"
artifacts:
    files:
        - "*/*"

Note: You may also integrate build commands into your GitHub repository using a buildspec YAML file. For more information, visit the Build specification reference for CodeBuild.

Leave all other options as default and click “Continue to CodePipeline”. Your project name will be filled in automatically. Click the “Skip deploy stage” button; we will address this in the next section. Review your changes and click “Create pipeline”. Your newly established pipeline will build for the first time!

Configure AWS CodeDeploy on Azure and On-Premises VMs

Now that we’ve built our application, we aim to deploy it to both Azure and on-premises environments. In the “Install CodeDeploy agent” section, we already installed the CodeDeploy agent. As a one-time step, we must now provide the CodeDeploy agents with access to the AWS environment. AWS Identity and Access Management (IAM) Roles Anywhere can be leveraged alongside the code-deploy-session-helper to grant access to necessary AWS resources. The IAM Role should at minimum include the AWSCodeDeployFullAccess managed policy and read-only access to the CodePipeline S3 bucket in your account (named codepipeline–).

For further details on setting up IAM Roles Anywhere, refer to this excellent resource.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *