By default, you cannot access your VPC resources when running CodeBuild projects. However, if required, the service can be configured to run the build environments within your designated VPCs and subnets. This allows it to access your private resources in the cloud or on-premises. This unlocks a lot of possibilities as you can run integration tests against resources that are privately available and not be worried about exposing anything over the internet.
Using CodeDeploy to orchestrate deployment workflows in compute environments
Software deployments could mean different things for different technology stacks. For Python-based applications, it could mean placing the scripts at a specific location, and for Java web apps, it could mean deploying WAR (web application archive) files on Tomcat. Whatever the requirement, CodeDeploy can help you deploy different compute environments. You can manage your deployments on servers (EC2/on-premises), Elastic Container Service (ECS), or even Lambda’s serverless platform.
Like CodeBuild, CodeDeploy depends on a manifest file, known as appspec.yml (which can also be JSON formatted). This file contains all the steps CodeDeploy needs to manage your application deployments. On EC2 instances or on-premises servers, this task is delegated to an agent that is already running alongside your application. With ECS and Lambda, the service directly speaks to the respective control plane to roll out application changes. When it comes to deployments, DevOps methodologies advocate the adoption of different strategies such as blue-green or canary to minimize risk. These capabilities are natively supported by CodeDeploy, making the overall process of introducing change much safer.
To make deployments happen, CodeDeploy uses several components that describe what to deploy, where to deploy, and how to deploy. Let’s see what they are and how they work.
Key components in CodeDeploy
It is important to be clear about the major components and the role they play before you start using the service.
Application – logical container for all configurations
An application in CodeDeploy wires all the configuration details together. As its name suggests, it identifies the application that is being deployed. When you reference an application’s name in the deployment, it selects the right combination of deployment group, configuration, and type.