Working with deployment strategies
A deployment strategy enables you to slowly release changes to production environments over minutes or hours. An AWS AppConfig deployment strategy defines the following important aspects of a configuration deployment.
Setting | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Deployment type |
Deployment type defines how the configuration deploys or rolls out. AWS AppConfig supports Linear and Exponential deployment types.
|
||||||||||||||
Step percentage (growth factor) |
This setting specifies the percentage of callers to target during each step of the deployment. NoteIn the SDK and the AWS AppConfig API
Reference, |
||||||||||||||
Deployment time |
This setting specifies an amount of time during which AWS AppConfig deploys to hosts. This is not a timeout value. It is a window of time during which the deployment is processed in intervals. |
||||||||||||||
Bake time |
This setting specifies the amount of time AWS AppConfig monitors for Amazon CloudWatch alarms after the configuration has been deployed to 100% of its targets, before considering the deployment to be complete. If an alarm is triggered during this time, AWS AppConfig rolls back the deployment. You must configure permissions for AWS AppConfig to roll back based on CloudWatch alarms. For more information, see Configure permissions for automatic rollback. |
You can choose a predefined strategy included with AWS AppConfig or create your own.
Predefined deployment strategies
AWS AppConfig includes predefined deployment strategies to help you quickly deploy a configuration. Instead of creating your own strategies, you can choose one of the following when you deploy a configuration.
Deployment strategy | Description |
---|---|
AppConfig.Linear20PercentEvery6Minutes |
AWS recommended: This strategy deploys the configuration to 20% of all targets every six minutes for a 30 minute deployment. The system monitors for Amazon CloudWatch alarms for 30 minutes. If no alarms are received in this time, the deployment is complete. If an alarm is triggered during this time, AWS AppConfig rolls back the deployment. We recommend using this strategy for production deployments because it aligns with AWS best practices and includes additional emphasis on deployment safety due to its long duration and bake time. |
AppConfig.Canary10Percent20Minutes |
AWS recommended: This strategy processes the deployment exponentially using a 10% growth factor over 20 minutes. The system monitors for CloudWatch alarms for 10 minutes. If no alarms are received in this time, the deployment is complete. If an alarm is triggered during this time, AWS AppConfig rolls back the deployment. We recommend using this strategy for production deployments because it aligns with AWS best practices for configuration deployments. |
AppConfig.AllAtOnce |
Quick: This strategy deploys the configuration to all targets immediately. The system monitors for CloudWatch alarms for 10 minutes. If no alarms are received in this time, the deployment is complete. If an alarm is triggered during this time, AWS AppConfig rolls back the deployment. |
AppConfig.Linear50PercentEvery30Seconds |
Testing/demonstration: This strategy deploys the configuration to half of all targets every 30 seconds for a one-minute deployment. The system monitors for Amazon CloudWatch alarms for 1 minute. If no alarms are received in this time, the deployment is complete. If an alarm is triggered during this time, AWS AppConfig rolls back the deployment. We recommend using this strategy only for testing or demonstration purposes because it has a short duration and bake time. |
Create a deployment strategy
If you don't want to use one of the predefined deployment strategies, you can create your own. You can create a maximum of 20 deployment strategies. When you deploy a configuration, you can choose the deployment strategy that works best for the application and the environment.
Creating an AWS AppConfig deployment strategy (console)
Use the following procedure to create an AWS AppConfig deployment strategy by using the AWS Systems Manager console.
To create a deployment strategy
Open the AWS Systems Manager console at https://console.aws.amazon.com/systems-manager/appconfig/
. -
In the navigation pane, choose Deployment strategies, and then choose Create deployment strategy.
-
For Name, enter a name for the deployment strategy.
-
For Description, enter information about the deployment strategy.
-
For Deployment type, choose a type.
-
For Step percentage, choose the percentage of callers to target during each step of the deployment.
-
For Deployment time, enter the total duration for the deployment in minutes or hours.
-
For Bake time, enter the total time, in minutes or hours, to monitor for Amazon CloudWatch alarms before proceeding to the next step of a deployment or before considering the deployment to be complete.
-
In the Tags section, enter a key and an optional value. You can specify a maximum of 50 tags for a resource.
-
Choose Create deployment strategy.
Important
If you created a configuration profile for AWS CodePipeline, then you must create a pipeline in CodePipeline that specifies AWS AppConfig as the deploy provider. You don't need to perform Deploying a configuration. However, you must configure a client to receive application configuration updates as described in Retrieving configurations by directly calling APIs. For information about creating a pipeline that specifies AWS AppConfig as the deploy provider, see Tutorial: Create a Pipeline that Uses AWS AppConfig as a Deployment Provider in the AWS CodePipeline User Guide.
Proceed to Deploying a configuration.
Creating an AWS AppConfig deployment strategy (command line)
The following procedure describes how to use the AWS CLI (on Linux or Windows) or AWS Tools for PowerShell to create an AWS AppConfig deployment strategy.
To create a deployment strategy step by step
-
Open the AWS CLI.
-
Run the following command to create a deployment strategy.
The system returns information like the following.