View a markdown version of this page

CodeDeploy agent configuration reference - AWS CodeDeploy

CodeDeploy agent configuration reference

When the CodeDeploy agent is installed, a configuration file is placed on the instance. This configuration file specifies directory paths and other settings for CodeDeploy to use as it interacts with the instance. You can change some of the configuration options in the file.

For Amazon Linux, Ubuntu Server, and Red Hat Enterprise Linux (RHEL) instances, the configuration file is named codedeployagent.yml. It is placed in the /etc/codedeploy-agent/conf directory.

For Windows Server instances, the configuration file is named conf.yml. It is placed in the C:\ProgramData\Amazon\CodeDeploy directory.

The configuration settings include:

:log_aws_wire:

Set to true for the CodeDeploy agent to capture wire logs from Amazon S3 and write them to a log file in the location pointed to by the :log_dir: setting.

For version 2.0.x and later, the filename is codedeploy-agent.aws_wire.log (created with 0640 permissions).

For version 1.8.x and earlier, the filename is codedeploy-agent.wire.log.

Warning

You should set :log_aws_wire: to true only for the amount of time required to capture wire logs. The wire log file can grow to a very large size quickly. The wire log output might contain sensitive information, including the plain-text contents of files transferred into, or out of, Amazon S3 while this setting was set to true. The wire logs contain information about all Amazon S3 activity associated with the AWS account while this setting was set to true, not just activity related to CodeDeploy deployments.

The default setting is false.

This setting applies to all instance types. You must add this configuration setting to Windows Server instances to be able to use it.

:log_dir:

The folder on the instance where log files related to CodeDeploy agent operations are stored.

The default setting is '/var/log/aws/codedeploy-agent' for Amazon Linux, Ubuntu Server, and RHEL instances and C:\ProgramData\Amazon\CodeDeploy\log for Windows Server instances.

:pid_dir:

The folder where codedeploy-agent.pid is stored.

This file contains the process ID (PID) of the CodeDeploy agent. The default setting is '/opt/codedeploy-agent/state/.pid'.

This setting applies to Amazon Linux, Ubuntu Server, and RHEL instances only.

:program_name:

The CodeDeploy agent program name.

The default setting is codedeploy-agent.

This setting applies to Amazon Linux, Ubuntu Server, and RHEL instances only.

:root_dir:

The folder where related revisions, deployment history, and deployment scripts on the instance are stored.

The default setting is /opt/codedeploy-agent/deployment-root for Amazon Linux, Ubuntu Server, and RHEL instances and C:\ProgramData\Amazon\CodeDeploy for Windows Server instances.

:verbose:

Set to true for the CodeDeploy agent to print debug messages log files on the instance.

The default setting is false.

:wait_between_runs:

The interval, in seconds, between CodeDeploy agent polling of CodeDeploy for pending deployments.

For version 2.0.x and later, the default setting is 30.

For version 1.8.x and earlier, the default setting is 1.

:on_premises_config_file:

For on-premises instances, the path to an alternate location for the configuration file named codedeploy.onpremises.yml (for Ubuntu Server and RHEL) or conf.onpremises.yml (for Windows Server).

By default, these files are stored in /etc/codedeploy-agent/conf/codedeploy.onpremises.yml for Ubuntu Server and RHEL and C:\ProgramData\Amazon\CodeDeploy\conf.onpremises.yml for Windows Server.

Available in version 1.0.1.686 and later versions of the CodeDeploy agent.

:proxy_uri:

(Optional) The HTTP proxy through which you want the CodeDeploy agent to connect to AWS for your CodeDeploy operations. Use a format similar to https://user:password@my.proxy:443/path?query.

Available in version 1.0.1.824 and later versions of the CodeDeploy agent.

:max_revisions:

(Optional) The number of application revisions for a deployment group that you want the CodeDeploy agent to archive. Any revisions that exceed the number specified are deleted.

Enter any positive integer. If no value is specified, CodeDeploy will retain the five most recent revisions in addition to the currently deployed revision.

Supported in version 1.0.1.966 and later versions of the CodeDeploy agent.

:enable_auth_policy:

(Optional) Set to true if you want to use IAM authorization to configure access control and limit permission of the IAM role or user that the CodeDeploy Agent is using. To Use CodeDeploy with Amazon Virtual Private Cloud, this value must be true.

The default setting is false.

:disable_imds_v1:

This setting is available with CodeDeploy agent 1.7.0 and later.

Set to true to disable the fallback to IMDSv1 when IMDSv2 errors occur. Defaults to false (enable the fallback).

:disable_core_dumps:

For version 2.0.x and later.

Set to true to suppress core dumps. Set to false for crash investigation.

The default setting is true.

:enable_command_port:

For version 2.0.x and later.

Set to true to enable the loopback-only (127.0.0.1) local management interface for querying agent status and injecting commands locally.

The default setting is false.

:reject_symlinks_in_bundle:

For version 2.0.x and later.

Set to true to reject bundles that contain symlinks or hardlinks.

The default setting is false.

:reject_path_traversal_in_bundle:

For version 2.0.x and later.

Set to true to reject archive entries that contain ../ path traversal or absolute paths, and AppSpec source fields that escape the bundle root.

The default setting is false.

:reject_unsafe_permissions_in_bundle:

For version 2.0.x and later.

Set to true to reject bundles that contain SUID/SGID files or AppSpec permission modes that set SUID/SGID.

The default setting is false.

:reject_unconfined_selinux_in_bundle:

For version 2.0.x and later.

Set to true to reject bundles that contain files with MAC-disabling SELinux types.

The default setting is false.

:reject_symlink_permission_targets:

For version 2.0.x and later.

Set to true to reject an AppSpec file permissions entry whose target is a symbolic link. By default, the agent follows the link when it applies ownership, mode, ACL, and SELinux changes.

The default setting is false.

:ignore_ownership_in_bundle:

For version 2.0.x and later.

Set to true to reset the ownership of files extracted from tar and tgz bundles to root instead of applying the user ID and group ID recorded in the archive. Files in zip bundles are owned by root regardless of this setting.

The default setting is false.

:restrict_agent_dir_permissions:

For version 2.0.x and later. Linux instances only.

Set to true to restrict the directories and files under the agent installation root to root-only access instead of the world-readable modes used by default.

The default setting is false.

:restrict_log_dir_permissions:

For version 2.0.x and later. Linux instances only.

Set to true to restrict the agent log directory, which contains the agent log and the updater log, to root-only access instead of the world-readable modes used by default.

The default setting is false.

:restrict_hook_env_to_allowlist:

For version 2.0.x and later.

Set to true to run lifecycle event hooks with a minimal environment that contains only basic shell variables and the CodeDeploy deployment variables. By default, hooks inherit the full environment of the agent process.

The default setting is false.

:strip_loader_env_in_hooks:

For version 2.0.x and later. Linux instances only.

Set to true to remove the LD_PRELOAD, LD_LIBRARY_PATH, and LD_AUDIT variables from the environment of lifecycle event hooks.

The default setting is false.

:disable_powershell_profile_in_hooks:

For version 2.0.x and later. Windows Server instances only.

Set to true to run .ps1 lifecycle event hooks with the -NoProfile and -NonInteractive options. By default, these hooks load the PowerShell profile of the user that the agent runs as.

The default setting is false.

:archive_max_extraction_size:

For version 2.0.x and later.

Sets a cap on the declared uncompressed bundle size. If the extracted content exceeds this value, the deployment fails.

The default is no cap (unlimited).

:wait_after_error:

The number of seconds the agent waits after encountering an error before resuming normal operation.

The default setting is 30.

:http_read_timeout:

The HTTP read timeout in seconds for service API calls.

The default setting is 80.

:kill_agent_max_wait_time_seconds:

The maximum number of seconds the agent waits for a graceful shutdown before force-terminating. For version 2.0.x and later, this value is capped at 24 hours (86400 seconds).

The default setting is 7200 (2 hours).

:enable_deployments_log:

Set to true to write the aggregated deployments log (codedeploy-agent-deployments.log).

The default setting is true.

:use_fips_mode:

Set to true to use FIPS-compliant endpoints. Applies to US Regions only.

The default setting is false.

:deploy_control_endpoint:

(Optional) A custom control-plane endpoint URL for the CodeDeploy service.

The default is no override (the agent resolves the endpoint from the Region).

:s3_endpoint_override:

(Optional) A custom Amazon S3 endpoint URL for bundle downloads.

The default is no override (the agent resolves the Amazon S3 endpoint from the Region).

:ongoing_deployment_tracking:

The name of the subdirectory used for deployment tracking state.

The default setting is ongoing-deployment.

Working with the CodeDeploy agent

Managing CodeDeploy agent operations