Skip to content

Commit 9c9494a

Browse files
author
awstools
committed
feat(client-appconfig): This release improves deployment safety by granting 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.
1 parent 073cb75 commit 9c9494a

12 files changed

+65
-19
lines changed

clients/client-appconfig/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Guide</a>.</p>
159159

160160
## Installing
161161

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

165165
- `npm install @aws-sdk/client-appconfig`

clients/client-appconfig/src/commands/CreateEnvironmentCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export interface CreateEnvironmentCommandOutput extends Environment, __MetadataB
6363
* // Id: "STRING_VALUE",
6464
* // Name: "STRING_VALUE",
6565
* // Description: "STRING_VALUE",
66-
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK",
66+
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
6767
* // Monitors: [ // MonitorList
6868
* // { // Monitor
6969
* // AlarmArn: "STRING_VALUE", // required

clients/client-appconfig/src/commands/GetDeploymentCommand.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ export interface GetDeploymentCommandOutput extends Deployment, __MetadataBearer
5656
* // GrowthType: "LINEAR" || "EXPONENTIAL",
5757
* // GrowthFactor: Number("float"),
5858
* // FinalBakeTimeInMinutes: Number("int"),
59-
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK",
59+
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
6060
* // EventLog: [ // DeploymentEvents
6161
* // { // DeploymentEvent
62-
* // EventType: "PERCENTAGE_UPDATED" || "ROLLBACK_STARTED" || "ROLLBACK_COMPLETED" || "BAKE_TIME_STARTED" || "DEPLOYMENT_STARTED" || "DEPLOYMENT_COMPLETED",
62+
* // EventType: "PERCENTAGE_UPDATED" || "ROLLBACK_STARTED" || "ROLLBACK_COMPLETED" || "BAKE_TIME_STARTED" || "DEPLOYMENT_STARTED" || "DEPLOYMENT_COMPLETED" || "REVERT_COMPLETED",
6363
* // TriggeredBy: "USER" || "APPCONFIG" || "CLOUDWATCH_ALARM" || "INTERNAL_ERROR",
6464
* // Description: "STRING_VALUE",
6565
* // ActionInvocations: [ // ActionInvocations

clients/client-appconfig/src/commands/GetEnvironmentCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export interface GetEnvironmentCommandOutput extends Environment, __MetadataBear
5151
* // Id: "STRING_VALUE",
5252
* // Name: "STRING_VALUE",
5353
* // Description: "STRING_VALUE",
54-
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK",
54+
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
5555
* // Monitors: [ // MonitorList
5656
* // { // Monitor
5757
* // AlarmArn: "STRING_VALUE", // required

clients/client-appconfig/src/commands/ListDeploymentsCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export interface ListDeploymentsCommandOutput extends Deployments, __MetadataBea
5353
* // GrowthType: "LINEAR" || "EXPONENTIAL",
5454
* // GrowthFactor: Number("float"),
5555
* // FinalBakeTimeInMinutes: Number("int"),
56-
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK",
56+
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
5757
* // PercentageComplete: Number("float"),
5858
* // StartedAt: new Date("TIMESTAMP"),
5959
* // CompletedAt: new Date("TIMESTAMP"),

clients/client-appconfig/src/commands/ListEnvironmentsCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export interface ListEnvironmentsCommandOutput extends Environments, __MetadataB
4949
* // Id: "STRING_VALUE",
5050
* // Name: "STRING_VALUE",
5151
* // Description: "STRING_VALUE",
52-
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK",
52+
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
5353
* // Monitors: [ // MonitorList
5454
* // { // Monitor
5555
* // AlarmArn: "STRING_VALUE", // required

clients/client-appconfig/src/commands/StartDeploymentCommand.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ export interface StartDeploymentCommandOutput extends Deployment, __MetadataBear
6666
* // GrowthType: "LINEAR" || "EXPONENTIAL",
6767
* // GrowthFactor: Number("float"),
6868
* // FinalBakeTimeInMinutes: Number("int"),
69-
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK",
69+
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
7070
* // EventLog: [ // DeploymentEvents
7171
* // { // DeploymentEvent
72-
* // EventType: "PERCENTAGE_UPDATED" || "ROLLBACK_STARTED" || "ROLLBACK_COMPLETED" || "BAKE_TIME_STARTED" || "DEPLOYMENT_STARTED" || "DEPLOYMENT_COMPLETED",
72+
* // EventType: "PERCENTAGE_UPDATED" || "ROLLBACK_STARTED" || "ROLLBACK_COMPLETED" || "BAKE_TIME_STARTED" || "DEPLOYMENT_STARTED" || "DEPLOYMENT_COMPLETED" || "REVERT_COMPLETED",
7373
* // TriggeredBy: "USER" || "APPCONFIG" || "CLOUDWATCH_ALARM" || "INTERNAL_ERROR",
7474
* // Description: "STRING_VALUE",
7575
* // ActionInvocations: [ // ActionInvocations

clients/client-appconfig/src/commands/StopDeploymentCommand.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ export interface StopDeploymentCommandOutput extends Deployment, __MetadataBeare
2929

3030
/**
3131
* <p>Stops a deployment. This API action works only on deployments that have a status of
32-
* <code>DEPLOYING</code>. This action moves the deployment to a status of
33-
* <code>ROLLED_BACK</code>.</p>
32+
* <code>DEPLOYING</code>, unless an <code>AllowRevert</code> parameter is supplied. If the
33+
* <code>AllowRevert</code> parameter is supplied, the status of an in-progress deployment
34+
* will be <code>ROLLED_BACK</code>. The status of a completed deployment will be
35+
* <code>REVERTED</code>. AppConfig only allows a revert within 72 hours of
36+
* deployment completion.</p>
3437
* @example
3538
* Use a bare-bones client and the command you need to make an API call.
3639
* ```javascript
@@ -41,6 +44,7 @@ export interface StopDeploymentCommandOutput extends Deployment, __MetadataBeare
4144
* ApplicationId: "STRING_VALUE", // required
4245
* EnvironmentId: "STRING_VALUE", // required
4346
* DeploymentNumber: Number("int"), // required
47+
* AllowRevert: true || false,
4448
* };
4549
* const command = new StopDeploymentCommand(input);
4650
* const response = await client.send(command);
@@ -58,10 +62,10 @@ export interface StopDeploymentCommandOutput extends Deployment, __MetadataBeare
5862
* // GrowthType: "LINEAR" || "EXPONENTIAL",
5963
* // GrowthFactor: Number("float"),
6064
* // FinalBakeTimeInMinutes: Number("int"),
61-
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK",
65+
* // State: "BAKING" || "VALIDATING" || "DEPLOYING" || "COMPLETE" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
6266
* // EventLog: [ // DeploymentEvents
6367
* // { // DeploymentEvent
64-
* // EventType: "PERCENTAGE_UPDATED" || "ROLLBACK_STARTED" || "ROLLBACK_COMPLETED" || "BAKE_TIME_STARTED" || "DEPLOYMENT_STARTED" || "DEPLOYMENT_COMPLETED",
68+
* // EventType: "PERCENTAGE_UPDATED" || "ROLLBACK_STARTED" || "ROLLBACK_COMPLETED" || "BAKE_TIME_STARTED" || "DEPLOYMENT_STARTED" || "DEPLOYMENT_COMPLETED" || "REVERT_COMPLETED",
6569
* // TriggeredBy: "USER" || "APPCONFIG" || "CLOUDWATCH_ALARM" || "INTERNAL_ERROR",
6670
* // Description: "STRING_VALUE",
6771
* // ActionInvocations: [ // ActionInvocations

clients/client-appconfig/src/commands/UpdateEnvironmentCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export interface UpdateEnvironmentCommandOutput extends Environment, __MetadataB
5454
* // Id: "STRING_VALUE",
5555
* // Name: "STRING_VALUE",
5656
* // Description: "STRING_VALUE",
57-
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK",
57+
* // State: "READY_FOR_DEPLOYMENT" || "DEPLOYING" || "ROLLING_BACK" || "ROLLED_BACK" || "REVERTED",
5858
* // Monitors: [ // MonitorList
5959
* // { // Monitor
6060
* // AlarmArn: "STRING_VALUE", // required

clients/client-appconfig/src/models/models_0.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,7 @@ export interface CreateEnvironmentRequest {
914914
export const EnvironmentState = {
915915
DEPLOYING: "DEPLOYING",
916916
READY_FOR_DEPLOYMENT: "READY_FOR_DEPLOYMENT",
917+
REVERTED: "REVERTED",
917918
ROLLED_BACK: "ROLLED_BACK",
918919
ROLLING_BACK: "ROLLING_BACK",
919920
} as const;
@@ -1626,8 +1627,9 @@ export interface GetConfigurationRequest {
16261627
* <code>ConfigurationVersion</code> attribute returned by <a>GetConfiguration</a> when there is new or updated data, and should be saved
16271628
* for subsequent calls to <a>GetConfiguration</a>.</p>
16281629
* </important>
1629-
* <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
1630-
* Configuration</a> in the <i>AppConfig User Guide</i>.</p>
1630+
* <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
1631+
* configuration data in AppConfig</a> in the <i>AppConfig
1632+
* User Guide</i>.</p>
16311633
* @public
16321634
*/
16331635
ClientConfigurationVersion?: string;
@@ -1690,6 +1692,7 @@ export const DeploymentEventType = {
16901692
DEPLOYMENT_COMPLETED: "DEPLOYMENT_COMPLETED",
16911693
DEPLOYMENT_STARTED: "DEPLOYMENT_STARTED",
16921694
PERCENTAGE_UPDATED: "PERCENTAGE_UPDATED",
1695+
REVERT_COMPLETED: "REVERT_COMPLETED",
16931696
ROLLBACK_COMPLETED: "ROLLBACK_COMPLETED",
16941697
ROLLBACK_STARTED: "ROLLBACK_STARTED",
16951698
} as const;
@@ -1775,6 +1778,7 @@ export const DeploymentState = {
17751778
BAKING: "BAKING",
17761779
COMPLETE: "COMPLETE",
17771780
DEPLOYING: "DEPLOYING",
1781+
REVERTED: "REVERTED",
17781782
ROLLED_BACK: "ROLLED_BACK",
17791783
ROLLING_BACK: "ROLLING_BACK",
17801784
VALIDATING: "VALIDATING",
@@ -2764,6 +2768,14 @@ export interface StopDeploymentRequest {
27642768
* @public
27652769
*/
27662770
DeploymentNumber: number | undefined;
2771+
2772+
/**
2773+
* <p>A Boolean that enables AppConfig to rollback a <code>COMPLETED</code>
2774+
* deployment to the previous configuration version. This action moves the deployment to a
2775+
* status of <code>REVERTED</code>.</p>
2776+
* @public
2777+
*/
2778+
AllowRevert?: boolean;
27672779
}
27682780

27692781
/**

clients/client-appconfig/src/protocols/Aws_restJson1.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,9 @@ export const se_StopDeploymentCommand = async (
868868
context: __SerdeContext
869869
): Promise<__HttpRequest> => {
870870
const b = rb(input, context);
871-
const headers: any = {};
871+
const headers: any = map({}, isSerializableHeaderValue, {
872+
[_ar]: [() => isSerializableHeaderValue(input[_AR]), () => input[_AR]!.toString()],
873+
});
872874
b.bp("/applications/{ApplicationId}/environments/{EnvironmentId}/deployments/{DeploymentNumber}");
873875
b.p("ApplicationId", () => input.ApplicationId!, "{ApplicationId}", false);
874876
b.p("EnvironmentId", () => input.EnvironmentId!, "{EnvironmentId}", false);
@@ -2548,6 +2550,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<st
25482550
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
25492551

25502552
const _AI = "ApplicationId";
2553+
const _AR = "AllowRevert";
25512554
const _CCV = "ClientConfigurationVersion";
25522555
const _CI = "ClientId";
25532556
const _CPI = "ConfigurationProfileId";
@@ -2568,6 +2571,7 @@ const _TK = "TagKeys";
25682571
const _VL = "VersionLabel";
25692572
const _VN = "VersionNumber";
25702573
const _ai = "application-id";
2574+
const _ar = "allow-revert";
25712575
const _ccv = "client_configuration_version";
25722576
const _ci = "client_id";
25732577
const _cpi = "configuration-profile-id";

codegen/sdk-codegen/aws-models/appconfig.json

+28-2
Original file line numberDiff line numberDiff line change
@@ -3028,6 +3028,12 @@
30283028
"traits": {
30293029
"smithy.api#enumValue": "DEPLOYMENT_COMPLETED"
30303030
}
3031+
},
3032+
"REVERT_COMPLETED": {
3033+
"target": "smithy.api#Unit",
3034+
"traits": {
3035+
"smithy.api#enumValue": "REVERT_COMPLETED"
3036+
}
30313037
}
30323038
}
30333039
},
@@ -3081,6 +3087,12 @@
30813087
"traits": {
30823088
"smithy.api#enumValue": "ROLLED_BACK"
30833089
}
3090+
},
3091+
"REVERTED": {
3092+
"target": "smithy.api#Unit",
3093+
"traits": {
3094+
"smithy.api#enumValue": "REVERTED"
3095+
}
30843096
}
30853097
}
30863098
},
@@ -3371,6 +3383,12 @@
33713383
"traits": {
33723384
"smithy.api#enumValue": "ROLLED_BACK"
33733385
}
3386+
},
3387+
"REVERTED": {
3388+
"target": "smithy.api#Unit",
3389+
"traits": {
3390+
"smithy.api#enumValue": "REVERTED"
3391+
}
33743392
}
33753393
}
33763394
},
@@ -3840,7 +3858,7 @@
38403858
"ClientConfigurationVersion": {
38413859
"target": "com.amazonaws.appconfig#Version",
38423860
"traits": {
3843-
"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>",
3861+
"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>",
38443862
"smithy.api#httpQuery": "client_configuration_version"
38453863
}
38463864
}
@@ -5529,7 +5547,7 @@
55295547
}
55305548
],
55315549
"traits": {
5532-
"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>",
5550+
"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>",
55335551
"smithy.api#examples": [
55345552
{
55355553
"title": "To stop configuration deployment",
@@ -5582,6 +5600,14 @@
55825600
"smithy.api#httpLabel": {},
55835601
"smithy.api#required": {}
55845602
}
5603+
},
5604+
"AllowRevert": {
5605+
"target": "com.amazonaws.appconfig#Boolean",
5606+
"traits": {
5607+
"smithy.api#default": null,
5608+
"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>",
5609+
"smithy.api#httpHeader": "Allow-Revert"
5610+
}
55855611
}
55865612
},
55875613
"traits": {

0 commit comments

Comments
 (0)