Menu
AWS CodeDeploy
User Guide (API Version 2014-10-06)

AppSpec File Structure

The following is the high-level structure for an AppSpec file used for deployments to AWS Lambda and EC2/On-Premises compute platforms.

AppSpec File Structure for AWS LambdaDeployments

Note

This AppSpec file is written in YAML, but you can also write an AppSpec file for a Lambda deployment in JSON using the same structure.

version: 0.0 resources: lambda-function-specifications hooks: deployment-lifecycle-event-mappings

In this structure:

version

This section specifies the version of the AppSpec file. Do not change this value. It is required. Currently, the only allowed value is 0.0. It is reserved by AWS CodeDeploy for future use.

resources

This section specifies information about the Lambda function to deploy.

For more information, see AppSpec 'resources' Section (AWS Lambda Deployments Only).

hooks

This section specifies Lambda functions to run at specific deployment lifecycle events to validate the deployment.

For more information, see AppSpec 'hooks' Section.

AppSpec File Structure for EC2/On-Premises Deployments

version: 0.0 os: operating-system-name files: source-destination-files-mappings permissions:high permissions-specifications hooks: deployment-lifecycle-event-mappings

In this structure:

version

This section specifies the version of the AppSpec file. Do not change this value. It is required. Currently, the only allowed value is 0.0. It is reserved by AWS CodeDeploy for future use.

os

This section specifies the operating system value of the instance to which you deploy. It is required. The following values can be specified:

  • linux – The instance is an Amazon Linux, Ubuntu Server, or RHEL instance.

  • windows – The instance is a Windows Server instance.

files

This section specifies the names of files that should be copied to the instance during the deployment's Install event.

For more information, see AppSpec 'files' Section (EC2/On-Premises Deployments Only).

permissions

This section specifies how special permissions, if any, should be applied to the files in the files section as they are being copied over to the instance. This section applies to Amazon Linux, Ubuntu Server, and Red Hat Enterprise Linux (RHEL) instances only.

For more information see, AppSpec 'permissions' Section (EC2/On-Premises Deployments Only).

hooks

This section specifies scripts to run at specific deployment lifecycle events during the deployment.

For more information, see AppSpec 'hooks' Section.