What is an AppSpec file?
The CodeDeploy service uses the YAML or JSON formatted AppSpec file to provide instructions for the deployment. This file is usually referred to as the appspec.yml
file and is provided with the deployment package.
When we deploy a package, the CodeDeploy agent reads this file and executes the instructions provided in the appsepc.yml
file. This file has two sections – one provides information regarding where the CodeDeploy agent needs to copy the artifact or package for installation, and another section contains the hooks to execute scripts for a specific deployment lifecycle.
The appspec.yml
file syntax changes a bit based on the target compute platform. In this chapter, we are focusing on deployment to EC2 instances, so we will discuss the appspec.yml
file syntax specific to the EC2/on-prem instance perspective, and in later chapters, we will cover the other two compute type-specific changes. The following is the structure of the appspec.yml
file...