Working with deployment strategies - Amazon AppConfig
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Working with deployment strategies

A deployment strategy enables you to slowly release changes to production environments over minutes or hours. An Amazon 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. Amazon AppConfig supports Linear and Exponential deployment types.

  • Linear: For this type, Amazon AppConfig processes the deployment by increments of the growth factor evenly distributed over the deployment. Here's an example timeline for a 10 hour deployment that uses 20% linear growth:

    Elapsed time Deployment progress

    0 hour

    0%

    2 hour

    20%

    4 hour

    40%

    6 hour

    60%

    8 hour

    80%

    10 hour

    100%

  • Exponential: For this type, Amazon AppConfig processes the deployment exponentially using the following formula: G*(2^N). In this formula, G is the step percentage specified by the user and N is the number of steps until the configuration is deployed to all targets. For example, if you specify a growth factor of 2, then the system rolls out the configuration as follows:

    2*(2^0) 2*(2^1) 2*(2^2)

    Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8% of the targets, and continues until the configuration has been deployed to all targets.

Step percentage (growth factor)

This setting specifies the percentage of callers to target during each step of the deployment.

Note

In the SDK and the Amazon AppConfig API Reference, step percentage is called growth factor.

Deployment time

This setting specifies an amount of time during which Amazon 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 Amazon 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, Amazon AppConfig rolls back the deployment. You must configure permissions for Amazon AppConfig to roll back based on CloudWatch alarms. For more information, see (Optional) Configure permissions for rollback based on CloudWatch alarms.

You can choose a predefined strategy included with Amazon AppConfig or create your own.

Predefined deployment strategies

Amazon 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

Amazon 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, Amazon AppConfig rolls back the deployment.

We recommend using this strategy for production deployments because it aligns with Amazon best practices and includes additional emphasis on deployment safety due to its long duration and bake time.

AppConfig.Canary10Percent20Minutes

Amazon 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, Amazon AppConfig rolls back the deployment.

We recommend using this strategy for production deployments because it aligns with Amazon 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, Amazon 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, Amazon 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

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 Amazon AppConfig deployment strategy (console)

Use the following procedure to create an Amazon AppConfig deployment strategy by using the Amazon Systems Manager console.

To create a deployment strategy
  1. Open the Amazon Systems Manager console at https://console.amazonaws.cn/systems-manager/appconfig/.

  2. In the navigation pane, choose Amazon AppConfig.

  3. Choose the Deployment Strategies tab, and then choose Create deployment strategy.

  4. For Name, enter a name for the deployment strategy.

  5. For Description, enter information about the deployment strategy.

  6. For Deployment type, choose a type.

  7. For Step percentage, choose the percentage of callers to target during each step of the deployment.

  8. For Deployment time, enter the total duration for the deployment in minutes or hours.

  9. 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.

  10. In the Tags section, enter a key and an optional value. You can specify a maximum of 50 tags for a resource.

  11. Choose Create deployment strategy.

Important

If you created a configuration profile for Amazon CodePipeline, then you must create a pipeline in CodePipeline that specifies Amazon 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 Amazon AppConfig as the deploy provider, see Tutorial: Create a Pipeline that Uses Amazon AppConfig as a Deployment Provider in the Amazon CodePipeline User Guide.

Proceed to Deploying a configuration.

Creating an Amazon AppConfig deployment strategy (command line)

The following procedure describes how to use the Amazon CLI (on Linux or Windows) or Amazon Tools for PowerShell to create an Amazon AppConfig deployment strategy.

To create a deployment strategy step by step
  1. Open the Amazon CLI.

  2. Run the following command to create a deployment strategy.

    Linux
    aws appconfig create-deployment-strategy \ --name A_name_for_the_deployment_strategy \ --description A_description_of_the_deployment_strategy \ --deployment-duration-in-minutes Total_amount_of_time_for_a_deployment_to_last \ --final-bake-time-in-minutes Amount_of_time_Amazon AppConfig_monitors_for_alarms_before_considering_the_deployment_to_be_complete \ --growth-factor The_percentage_of_targets_to_receive_a_deployed_configuration_during_each_interval \ --growth-type The_linear_or_exponential_algorithm_used_to_define_how_percentage_grows_over_time \ --replicate-to To_save_the_deployment_strategy_to_a_Systems_Manager_(SSM)_document \ --tags User_defined_key_value_pair_metadata_of_the_deployment_strategy
    Windows
    aws appconfig create-deployment-strategy ^ --name A_name_for_the_deployment_strategy ^ --description A_description_of_the_deployment_strategy ^ --deployment-duration-in-minutes Total_amount_of_time_for_a_deployment_to_last ^ --final-bake-time-in-minutes Amount_of_time_Amazon AppConfig_monitors_for_alarms_before_considering_the_deployment_to_be_complete ^ --growth-factor The_percentage_of_targets_to_receive_a_deployed_configuration_during_each_interval ^ --growth-type The_linear_or_exponential_algorithm_used_to_define_how_percentage_grows_over_time ^ --name A_name_for_the_deployment_strategy ^ --replicate-to To_save_the_deployment_strategy_to_a_Systems_Manager_(SSM)_document ^ --tags User_defined_key_value_pair_metadata_of_the_deployment_strategy
    PowerShell
    New-APPCDeploymentStrategy ` --Name A_name_for_the_deployment_strategy ` --Description A_description_of_the_deployment_strategy ` --DeploymentDurationInMinutes Total_amount_of_time_for_a_deployment_to_last ` --FinalBakeTimeInMinutes Amount_of_time_Amazon AppConfig_monitors_for_alarms_before_considering_the_deployment_to_be_complete ` --GrowthFactor The_percentage_of_targets_to_receive_a_deployed_configuration_during_each_interval ` --GrowthType The_linear_or_exponential_algorithm_used_to_define_how_percentage_grows_over_time ` --ReplicateTo To_save_the_deployment_strategy_to_a_Systems_Manager_(SSM)_document ` --Tag Hashtable_type_User_defined_key_value_pair_metadata_of_the_deployment_strategy

    The system returns information like the following.

    Linux
    {
       "Id": "Id of the deployment strategy",
       "Name": "Name of the deployment strategy",
       "Description": "Description of the deployment strategy",
       "DeploymentDurationInMinutes": "Total amount of time the deployment lasted",
       "GrowthType": "The linear or exponential algorithm used to define how percentage grew over time",
       "GrowthFactor": "The percentage of targets that received a deployed configuration during each interval",  
       "FinalBakeTimeInMinutes": "The amount of time Amazon AppConfig monitored for alarms before considering the deployment to be complete",
       "ReplicateTo": "The Systems Manager (SSM) document where the deployment strategy is saved"
    }
    Windows
    {
       "Id": "Id of the deployment strategy",
       "Name": "Name of the deployment strategy",
       "Description": "Description of the deployment strategy",
       "DeploymentDurationInMinutes": "Total amount of time the deployment lasted",
       "GrowthType": "The linear or exponential algorithm used to define how percentage grew over time",
       "GrowthFactor": "The percentage of targets that received a deployed configuration during each interval",  
       "FinalBakeTimeInMinutes": "The amount of time Amazon AppConfig monitored for alarms before considering the deployment to be complete",
       "ReplicateTo": "The Systems Manager (SSM) document where the deployment strategy is saved"
    }
    PowerShell
    ContentLength               : Runtime of the command
    DeploymentDurationInMinutes : Total amount of time the deployment lasted
    Description                 : Description of the deployment strategy
    FinalBakeTimeInMinutes      : The amount of time Amazon AppConfig monitored for alarms before considering the deployment to be complete
    GrowthFactor                : The percentage of targets that received a deployed configuration during each interval
    GrowthType                  : The linear or exponential algorithm used to define how percentage grew over time
    HttpStatusCode              : HTTP Status of the runtime
    Id                          : The deployment strategy ID
    Name                        : Name of the deployment strategy
    ReplicateTo                 : The Systems Manager (SSM) document where the deployment strategy is saved
    ResponseMetadata            : Runtime Metadata