AWS CloudFormation
User Guide (Version )

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

AWS::CodeDeploy::DeploymentConfig

The AWS::CodeDeploy::DeploymentConfig resource creates a set of deployment rules, deployment success conditions, and deployment failure conditions that AWS CodeDeploy uses during a deployment. The deployment configuration specifies, through the use of a MinimumHealthyHosts value, the number or percentage of instances that must remain available at any time during a deployment.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::CodeDeploy::DeploymentConfig", "Properties" : { "DeploymentConfigName" : String, "MinimumHealthyHosts" : MinimumHealthyHosts } }

YAML

Type: AWS::CodeDeploy::DeploymentConfig Properties: DeploymentConfigName: String MinimumHealthyHosts: MinimumHealthyHosts

Properties

DeploymentConfigName

A name for the deployment configuration. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the deployment configuration name. For more information, see Name Type.

Important

If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.

Required: No

Type: String

Minimum: 1

Maximum: 100

Update requires: Replacement

MinimumHealthyHosts

The minimum number of healthy instances that should be available at any time during the deployment. There are two parameters expected in the input: type and value.

The type parameter takes either of the following values:

  • HOST_COUNT: The value parameter represents the minimum number of healthy instances as an absolute value.

  • FLEET_PERCENT: The value parameter represents the minimum number of healthy instances as a percentage of the total number of instances in the deployment. If you specify FLEET_PERCENT, at the start of the deployment, AWS CodeDeploy converts the percentage to the equivalent number of instance and rounds up fractional instances.

The value parameter takes an integer.

For example, to set a minimum of 95% healthy instance, specify a type of FLEET_PERCENT and a value of 95.

For more information about instance health, see CodeDeploy Instance Health in the AWS CodeDeploy User Guide.

Required: No

Type: MinimumHealthyHosts

Update requires: Replacement

Return Values

Ref

When you pass the logical ID of an AWS::CodeDeploy::DeploymentConfig resource to the intrinsic Ref function, the function returns the deployment configuration name, such as mydeploymentconfig-a123d0d1.

For more information about using the Ref function, see Ref.

Examples

Specifying minimum healthy hosts

The following example requires at least 75% of the fleet to be healthy. For example, if you had a fleet of four instances, the deployment proceeds one instance at a time.

JSON

"TwentyFivePercentAtATime" : { "Type" : "AWS::CodeDeploy::DeploymentConfig", "Properties" : { "MinimumHealthyHosts" : { "Type" : "FLEET_PERCENT", "Value" : 75 } } }

YAML

TwentyFivePercentAtATime: Type: AWS::CodeDeploy::DeploymentConfig Properties: MinimumHealthyHosts: Type: "FLEET_PERCENT" Value: 75