Skip to content

Commit

Permalink
feat(client-appconfig): This release improves deployment safety by gr…
Browse files Browse the repository at this point in the history
…anting customers the ability to REVERT completed deployments, to the last known good state.In the StopDeployment API revert case the status of a COMPLETE deployment will be REVERTED. AppConfig only allows a revert within 72 hours of deployment completion.
  • Loading branch information
awstools committed Oct 24, 2024
1 parent 073cb75 commit 9c9494a
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 19 deletions.
2 changes: 1 addition & 1 deletion clients/client-appconfig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Guide</a>.</p>

## Installing

To install the this package, simply type add or install @aws-sdk/client-appconfig
To install this package, simply type add or install @aws-sdk/client-appconfig
using your favorite package manager:

- `npm install @aws-sdk/client-appconfig`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export interface CreateEnvironmentCommandOutput extends Environment, __MetadataB
* // Id: "STRING_VALUE",
* // Name: "STRING_VALUE",
* // Description: "STRING_VALUE",
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK",
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
* // Monitors: [ // MonitorList
* // { // Monitor
* // AlarmArn: "STRING_VALUE", // required
Expand Down
4 changes: 2 additions & 2 deletions clients/client-appconfig/src/commands/GetDeploymentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ export interface GetDeploymentCommandOutput extends Deployment, __MetadataBearer
* // GrowthType: "LINEAR" || "EXPONENTIAL",
* // GrowthFactor: Number("float"),
* // FinalBakeTimeInMinutes: Number("int"),
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK",
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
* // EventLog: [ // DeploymentEvents
* // { // DeploymentEvent
* // EventType: "PERCENTAGE_UPDATED" || "ROLLBACK_STARTED" || "ROLLBACK_COMPLETED" || "BAKE_TIME_STARTED" || "DEPLOYMENT_STARTED" || "DEPLOYMENT_COMPLETED",
* // EventType: "PERCENTAGE_UPDATED" || "ROLLBACK_STARTED" || "ROLLBACK_COMPLETED" || "BAKE_TIME_STARTED" || "DEPLOYMENT_STARTED" || "DEPLOYMENT_COMPLETED" || "REVERT_COMPLETED",
* // TriggeredBy: "USER" || "APPCONFIG" || "CLOUDWATCH_ALARM" || "INTERNAL_ERROR",
* // Description: "STRING_VALUE",
* // ActionInvocations: [ // ActionInvocations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export interface GetEnvironmentCommandOutput extends Environment, __MetadataBear
* // Id: "STRING_VALUE",
* // Name: "STRING_VALUE",
* // Description: "STRING_VALUE",
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK",
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
* // Monitors: [ // MonitorList
* // { // Monitor
* // AlarmArn: "STRING_VALUE", // required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface ListDeploymentsCommandOutput extends Deployments, __MetadataBea
* // GrowthType: "LINEAR" || "EXPONENTIAL",
* // GrowthFactor: Number("float"),
* // FinalBakeTimeInMinutes: Number("int"),
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK",
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
* // PercentageComplete: Number("float"),
* // StartedAt: new Date("TIMESTAMP"),
* // CompletedAt: new Date("TIMESTAMP"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface ListEnvironmentsCommandOutput extends Environments, __MetadataB
* // Id: "STRING_VALUE",
* // Name: "STRING_VALUE",
* // Description: "STRING_VALUE",
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK",
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
* // Monitors: [ // MonitorList
* // { // Monitor
* // AlarmArn: "STRING_VALUE", // required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ export interface StartDeploymentCommandOutput extends Deployment, __MetadataBear
* // GrowthType: "LINEAR" || "EXPONENTIAL",
* // GrowthFactor: Number("float"),
* // FinalBakeTimeInMinutes: Number("int"),
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK",
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
* // EventLog: [ // DeploymentEvents
* // { // DeploymentEvent
* // EventType: "PERCENTAGE_UPDATED" || "ROLLBACK_STARTED" || "ROLLBACK_COMPLETED" || "BAKE_TIME_STARTED" || "DEPLOYMENT_STARTED" || "DEPLOYMENT_COMPLETED",
* // EventType: "PERCENTAGE_UPDATED" || "ROLLBACK_STARTED" || "ROLLBACK_COMPLETED" || "BAKE_TIME_STARTED" || "DEPLOYMENT_STARTED" || "DEPLOYMENT_COMPLETED" || "REVERT_COMPLETED",
* // TriggeredBy: "USER" || "APPCONFIG" || "CLOUDWATCH_ALARM" || "INTERNAL_ERROR",
* // Description: "STRING_VALUE",
* // ActionInvocations: [ // ActionInvocations
Expand Down
12 changes: 8 additions & 4 deletions clients/client-appconfig/src/commands/StopDeploymentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ export interface StopDeploymentCommandOutput extends Deployment, __MetadataBeare

/**
* <p>Stops a deployment. This API action works only on deployments that have a status of
* <code>DEPLOYING</code>. This action moves the deployment to a status of
* <code>ROLLED_BACK</code>.</p>
* <code>DEPLOYING</code>, unless an <code>AllowRevert</code> parameter is supplied. If the
* <code>AllowRevert</code> parameter is supplied, the status of an in-progress deployment
* will be <code>ROLLED_BACK</code>. The status of a completed deployment will be
* <code>REVERTED</code>. AppConfig only allows a revert within 72 hours of
* deployment completion.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand All @@ -41,6 +44,7 @@ export interface StopDeploymentCommandOutput extends Deployment, __MetadataBeare
* ApplicationId: "STRING_VALUE", // required
* EnvironmentId: "STRING_VALUE", // required
* DeploymentNumber: Number("int"), // required
* AllowRevert: true || false,
* };
* const command = new StopDeploymentCommand(input);
* const response = await client.send(command);
Expand All @@ -58,10 +62,10 @@ export interface StopDeploymentCommandOutput extends Deployment, __MetadataBeare
* // GrowthType: "LINEAR" || "EXPONENTIAL",
* // GrowthFactor: Number("float"),
* // FinalBakeTimeInMinutes: Number("int"),
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK",
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
* // EventLog: [ // DeploymentEvents
* // { // DeploymentEvent
* // EventType: "PERCENTAGE_UPDATED" || "ROLLBACK_STARTED" || "ROLLBACK_COMPLETED" || "BAKE_TIME_STARTED" || "DEPLOYMENT_STARTED" || "DEPLOYMENT_COMPLETED",
* // EventType: "PERCENTAGE_UPDATED" || "ROLLBACK_STARTED" || "ROLLBACK_COMPLETED" || "BAKE_TIME_STARTED" || "DEPLOYMENT_STARTED" || "DEPLOYMENT_COMPLETED" || "REVERT_COMPLETED",
* // TriggeredBy: "USER" || "APPCONFIG" || "CLOUDWATCH_ALARM" || "INTERNAL_ERROR",
* // Description: "STRING_VALUE",
* // ActionInvocations: [ // ActionInvocations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface UpdateEnvironmentCommandOutput extends Environment, __MetadataB
* // Id: "STRING_VALUE",
* // Name: "STRING_VALUE",
* // Description: "STRING_VALUE",
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK",
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
* // Monitors: [ // MonitorList
* // { // Monitor
* // AlarmArn: "STRING_VALUE", // required
Expand Down
16 changes: 14 additions & 2 deletions clients/client-appconfig/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,7 @@ export interface CreateEnvironmentRequest {
export const EnvironmentState = {
DEPLOYING: "DEPLOYING",
READY_FOR_DEPLOYMENT: "READY_FOR_DEPLOYMENT",
REVERTED: "REVERTED",
ROLLED_BACK: "ROLLED_BACK",
ROLLING_BACK: "ROLLING_BACK",
} as const;
Expand Down Expand Up @@ -1626,8 +1627,9 @@ export interface GetConfigurationRequest {
* <code>ConfigurationVersion</code> attribute returned by <a>GetConfiguration</a> when there is new or updated data, and should be saved
* for subsequent calls to <a>GetConfiguration</a>.</p>
* </important>
* <p>For more information about working with configurations, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration.html">Retrieving the
* Configuration</a> in the <i>AppConfig User Guide</i>.</p>
* <p>For more information about working with configurations, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/retrieving-feature-flags.html">Retrieving feature flags and
* configuration data in AppConfig</a> in the <i>AppConfig
* User Guide</i>.</p>
* @public
*/
ClientConfigurationVersion?: string;
Expand Down Expand Up @@ -1690,6 +1692,7 @@ export const DeploymentEventType = {
DEPLOYMENT_COMPLETED: "DEPLOYMENT_COMPLETED",
DEPLOYMENT_STARTED: "DEPLOYMENT_STARTED",
PERCENTAGE_UPDATED: "PERCENTAGE_UPDATED",
REVERT_COMPLETED: "REVERT_COMPLETED",
ROLLBACK_COMPLETED: "ROLLBACK_COMPLETED",
ROLLBACK_STARTED: "ROLLBACK_STARTED",
} as const;
Expand Down Expand Up @@ -1775,6 +1778,7 @@ export const DeploymentState = {
BAKING: "BAKING",
COMPLETE: "COMPLETE",
DEPLOYING: "DEPLOYING",
REVERTED: "REVERTED",
ROLLED_BACK: "ROLLED_BACK",
ROLLING_BACK: "ROLLING_BACK",
VALIDATING: "VALIDATING",
Expand Down Expand Up @@ -2764,6 +2768,14 @@ export interface StopDeploymentRequest {
* @public
*/
DeploymentNumber: number | undefined;

/**
* <p>A Boolean that enables AppConfig to rollback a <code>COMPLETED</code>
* deployment to the previous configuration version. This action moves the deployment to a
* status of <code>REVERTED</code>.</p>
* @public
*/
AllowRevert?: boolean;
}

/**
Expand Down
6 changes: 5 additions & 1 deletion clients/client-appconfig/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,9 @@ export const se_StopDeploymentCommand = async (
context: __SerdeContext
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = {};
const headers: any = map({}, isSerializableHeaderValue, {
[_ar]: [() => isSerializableHeaderValue(input[_AR]), () => input[_AR]!.toString()],
});
b.bp("/applications/{ApplicationId}/environments/{EnvironmentId}/deployments/{DeploymentNumber}");
b.p("ApplicationId", () => input.ApplicationId!, "{ApplicationId}", false);
b.p("EnvironmentId", () => input.EnvironmentId!, "{EnvironmentId}", false);
Expand Down Expand Up @@ -2548,6 +2550,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<st
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

const _AI = "ApplicationId";
const _AR = "AllowRevert";
const _CCV = "ClientConfigurationVersion";
const _CI = "ClientId";
const _CPI = "ConfigurationProfileId";
Expand All @@ -2568,6 +2571,7 @@ const _TK = "TagKeys";
const _VL = "VersionLabel";
const _VN = "VersionNumber";
const _ai = "application-id";
const _ar = "allow-revert";
const _ccv = "client_configuration_version";
const _ci = "client_id";
const _cpi = "configuration-profile-id";
Expand Down
30 changes: 28 additions & 2 deletions codegen/sdk-codegen/aws-models/appconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3028,6 +3028,12 @@
"traits": {
"smithy.api#enumValue": "DEPLOYMENT_COMPLETED"
}
},
"REVERT_COMPLETED": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "REVERT_COMPLETED"
}
}
}
},
Expand Down Expand Up @@ -3081,6 +3087,12 @@
"traits": {
"smithy.api#enumValue": "ROLLED_BACK"
}
},
"REVERTED": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "REVERTED"
}
}
}
},
Expand Down Expand Up @@ -3371,6 +3383,12 @@
"traits": {
"smithy.api#enumValue": "ROLLED_BACK"
}
},
"REVERTED": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "REVERTED"
}
}
}
},
Expand Down Expand Up @@ -3840,7 +3858,7 @@
"ClientConfigurationVersion": {
"target": "com.amazonaws.appconfig#Version",
"traits": {
"smithy.api#documentation": "<p>The configuration version returned in the most recent <a>GetConfiguration</a>\n response.</p>\n <important>\n <p>AppConfig uses the value of the <code>ClientConfigurationVersion</code>\n parameter to identify the configuration version on your clients. If you don’t send\n <code>ClientConfigurationVersion</code> with each call to <a>GetConfiguration</a>, your clients receive the current configuration. You are\n charged each time your clients receive a configuration.</p>\n <p>To avoid excess charges, we recommend you use the <a href=\"https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/StartConfigurationSession.html\">StartConfigurationSession</a> and <a href=\"https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/GetLatestConfiguration.html\">GetLatestConfiguration</a> APIs, which track the client configuration version on\n your behalf. If you choose to continue using <a>GetConfiguration</a>, we\n recommend that you include the <code>ClientConfigurationVersion</code> value with every\n call to <a>GetConfiguration</a>. The value to use for\n <code>ClientConfigurationVersion</code> comes from the\n <code>ConfigurationVersion</code> attribute returned by <a>GetConfiguration</a> when there is new or updated data, and should be saved\n for subsequent calls to <a>GetConfiguration</a>.</p>\n </important>\n <p>For more information about working with configurations, see <a href=\"http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration.html\">Retrieving the\n Configuration</a> in the <i>AppConfig User Guide</i>.</p>",
"smithy.api#documentation": "<p>The configuration version returned in the most recent <a>GetConfiguration</a>\n response.</p>\n <important>\n <p>AppConfig uses the value of the <code>ClientConfigurationVersion</code>\n parameter to identify the configuration version on your clients. If you don’t send\n <code>ClientConfigurationVersion</code> with each call to <a>GetConfiguration</a>, your clients receive the current configuration. You are\n charged each time your clients receive a configuration.</p>\n <p>To avoid excess charges, we recommend you use the <a href=\"https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/StartConfigurationSession.html\">StartConfigurationSession</a> and <a href=\"https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/GetLatestConfiguration.html\">GetLatestConfiguration</a> APIs, which track the client configuration version on\n your behalf. If you choose to continue using <a>GetConfiguration</a>, we\n recommend that you include the <code>ClientConfigurationVersion</code> value with every\n call to <a>GetConfiguration</a>. The value to use for\n <code>ClientConfigurationVersion</code> comes from the\n <code>ConfigurationVersion</code> attribute returned by <a>GetConfiguration</a> when there is new or updated data, and should be saved\n for subsequent calls to <a>GetConfiguration</a>.</p>\n </important>\n <p>For more information about working with configurations, see <a href=\"http://docs.aws.amazon.com/appconfig/latest/userguide/retrieving-feature-flags.html\">Retrieving feature flags and\n configuration data in AppConfig</a> in the <i>AppConfig\n User Guide</i>.</p>",
"smithy.api#httpQuery": "client_configuration_version"
}
}
Expand Down Expand Up @@ -5529,7 +5547,7 @@
}
],
"traits": {
"smithy.api#documentation": "<p>Stops a deployment. This API action works only on deployments that have a status of\n <code>DEPLOYING</code>. This action moves the deployment to a status of\n <code>ROLLED_BACK</code>.</p>",
"smithy.api#documentation": "<p>Stops a deployment. This API action works only on deployments that have a status of\n <code>DEPLOYING</code>, unless an <code>AllowRevert</code> parameter is supplied. If the\n <code>AllowRevert</code> parameter is supplied, the status of an in-progress deployment\n will be <code>ROLLED_BACK</code>. The status of a completed deployment will be\n <code>REVERTED</code>. AppConfig only allows a revert within 72 hours of\n deployment completion.</p>",
"smithy.api#examples": [
{
"title": "To stop configuration deployment",
Expand Down Expand Up @@ -5582,6 +5600,14 @@
"smithy.api#httpLabel": {},
"smithy.api#required": {}
}
},
"AllowRevert": {
"target": "com.amazonaws.appconfig#Boolean",
"traits": {
"smithy.api#default": null,
"smithy.api#documentation": "<p>A Boolean that enables AppConfig to rollback a <code>COMPLETED</code>\n deployment to the previous configuration version. This action moves the deployment to a\n status of <code>REVERTED</code>.</p>",
"smithy.api#httpHeader": "Allow-Revert"
}
}
},
"traits": {
Expand Down

0 comments on commit 9c9494a

Please sign in to comment.