CreateDeploymentStrategyCommand

Creates a deployment strategy that defines important criteria for rolling out your configuration to the designated targets. A deployment strategy includes the overall duration required, a percentage of targets to receive the deployment during each interval, an algorithm that defines how percentage grows, and bake time.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { AppConfigClient, CreateDeploymentStrategyCommand } from "@aws-sdk/client-appconfig"; // ES Modules import
// const { AppConfigClient, CreateDeploymentStrategyCommand } = require("@aws-sdk/client-appconfig"); // CommonJS import
const client = new AppConfigClient(config);
const input = { // CreateDeploymentStrategyRequest
  Name: "STRING_VALUE", // required
  Description: "STRING_VALUE",
  DeploymentDurationInMinutes: Number("int"), // required
  FinalBakeTimeInMinutes: Number("int"),
  GrowthFactor: Number("float"), // required
  GrowthType: "LINEAR" || "EXPONENTIAL",
  ReplicateTo: "NONE" || "SSM_DOCUMENT",
  Tags: { // TagMap
    "<keys>": "STRING_VALUE",
  },
};
const command = new CreateDeploymentStrategyCommand(input);
const response = await client.send(command);
// { // DeploymentStrategy
//   Id: "STRING_VALUE",
//   Name: "STRING_VALUE",
//   Description: "STRING_VALUE",
//   DeploymentDurationInMinutes: Number("int"),
//   GrowthType: "LINEAR" || "EXPONENTIAL",
//   GrowthFactor: Number("float"),
//   FinalBakeTimeInMinutes: Number("int"),
//   ReplicateTo: "NONE" || "SSM_DOCUMENT",
// };

Example Usage

 There was an error loading the code editor. Retry

CreateDeploymentStrategyCommand Input

Parameter
Type
Description
DeploymentDurationInMinutes
Required
number | undefined

Total amount of time for a deployment to last.

GrowthFactor
Required
number | undefined

The percentage of targets to receive a deployed configuration during each interval.

Name
Required
string | undefined

A name for the deployment strategy.

Description
string | undefined

A description of the deployment strategy.

FinalBakeTimeInMinutes
number | undefined

Specifies the amount of time 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, AppConfig rolls back the deployment. You must configure permissions for AppConfig to roll back based on CloudWatch alarms. For more information, see Configuring permissions for rollback based on Amazon CloudWatch alarms  in the AppConfig User Guide.

GrowthType
GrowthType | undefined

The algorithm used to define how percentage grows over time. AppConfig supports the following growth types:

Linear: For this type, AppConfig processes the deployment by dividing the total number of targets by the value specified for Step percentage. For example, a linear deployment that uses a Step percentage of 10 deploys the configuration to 10 percent of the hosts. After those deployments are complete, the system deploys the configuration to the next 10 percent. This continues until 100% of the targets have successfully received the configuration.

Exponential: For this type, AppConfig processes the deployment exponentially using the following formula: G*(2^N). In this formula, G is the growth factor 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.

ReplicateTo
ReplicateTo | undefined

Save the deployment strategy to a Systems Manager (SSM) document.

Tags
Record<string, string> | undefined

Metadata to assign to the deployment strategy. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.

CreateDeploymentStrategyCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
DeploymentDurationInMinutes
number | undefined

Total amount of time the deployment lasted.

Description
string | undefined

The description of the deployment strategy.

FinalBakeTimeInMinutes
number | undefined

The amount of time that AppConfig monitored for alarms before considering the deployment to be complete and no longer eligible for automatic rollback.

GrowthFactor
number | undefined

The percentage of targets that received a deployed configuration during each interval.

GrowthType
GrowthType | undefined

The algorithm used to define how percentage grew over time.

Id
string | undefined

The deployment strategy ID.

Name
string | undefined

The name of the deployment strategy.

ReplicateTo
ReplicateTo | undefined

Save the deployment strategy to a Systems Manager (SSM) document.

Throws

Name
Fault
Details
BadRequestException
client

The input fails to satisfy the constraints specified by an Amazon Web Services service.

InternalServerException
server

There was an internal failure in the AppConfig service.

ServiceQuotaExceededException
client

The number of one more AppConfig resources exceeds the maximum allowed. Verify that your environment doesn't exceed the following service quotas:

Applications: 100 max

Deployment strategies: 20 max

Configuration profiles: 100 max per application

Environments: 20 max per application

To resolve this issue, you can delete one or more resources and try again. Or, you can request a quota increase. For more information about quotas and to request an increase, see Service quotas for AppConfig  in the Amazon Web Services General Reference.

AppConfigServiceException
Base exception class for all service exceptions from AppConfig service.