Skip to content

Commit e2c85d3

Browse files
author
awstools
committed
feat(client-ecs): This release supports hook details for Amazon ECS lifecycle hooks.
1 parent 6147f35 commit e2c85d3

File tree

9 files changed

+186
-22
lines changed

9 files changed

+186
-22
lines changed

clients/client-ecs/src/commands/CreateServiceCommand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ export interface CreateServiceCommandOutput extends CreateServiceResponse, __Met
253253
* lifecycleStages: [ // DeploymentLifecycleHookStageList
254254
* "RECONCILE_SERVICE" || "PRE_SCALE_UP" || "POST_SCALE_UP" || "TEST_TRAFFIC_SHIFT" || "POST_TEST_TRAFFIC_SHIFT" || "PRODUCTION_TRAFFIC_SHIFT" || "POST_PRODUCTION_TRAFFIC_SHIFT",
255255
* ],
256+
* hookDetails: "DOCUMENT_VALUE",
256257
* },
257258
* ],
258259
* },
@@ -445,6 +446,7 @@ export interface CreateServiceCommandOutput extends CreateServiceResponse, __Met
445446
* // lifecycleStages: [ // DeploymentLifecycleHookStageList
446447
* // "RECONCILE_SERVICE" || "PRE_SCALE_UP" || "POST_SCALE_UP" || "TEST_TRAFFIC_SHIFT" || "POST_TEST_TRAFFIC_SHIFT" || "PRODUCTION_TRAFFIC_SHIFT" || "POST_PRODUCTION_TRAFFIC_SHIFT",
447448
* // ],
449+
* // hookDetails: "DOCUMENT_VALUE",
448450
* // },
449451
* // ],
450452
* // },

clients/client-ecs/src/commands/DeleteServiceCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export interface DeleteServiceCommandOutput extends DeleteServiceResponse, __Met
127127
* // lifecycleStages: [ // DeploymentLifecycleHookStageList
128128
* // "RECONCILE_SERVICE" || "PRE_SCALE_UP" || "POST_SCALE_UP" || "TEST_TRAFFIC_SHIFT" || "POST_TEST_TRAFFIC_SHIFT" || "PRODUCTION_TRAFFIC_SHIFT" || "POST_PRODUCTION_TRAFFIC_SHIFT",
129129
* // ],
130+
* // hookDetails: "DOCUMENT_VALUE",
130131
* // },
131132
* // ],
132133
* // },

clients/client-ecs/src/commands/DescribeServiceDeploymentsCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export interface DescribeServiceDeploymentsCommandOutput extends DescribeService
9595
* // lifecycleStages: [ // DeploymentLifecycleHookStageList
9696
* // "RECONCILE_SERVICE" || "PRE_SCALE_UP" || "POST_SCALE_UP" || "TEST_TRAFFIC_SHIFT" || "POST_TEST_TRAFFIC_SHIFT" || "PRODUCTION_TRAFFIC_SHIFT" || "POST_PRODUCTION_TRAFFIC_SHIFT",
9797
* // ],
98+
* // hookDetails: "DOCUMENT_VALUE",
9899
* // },
99100
* // ],
100101
* // },

clients/client-ecs/src/commands/DescribeServicesCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export interface DescribeServicesCommandOutput extends DescribeServicesResponse,
112112
* // lifecycleStages: [ // DeploymentLifecycleHookStageList
113113
* // "RECONCILE_SERVICE" || "PRE_SCALE_UP" || "POST_SCALE_UP" || "TEST_TRAFFIC_SHIFT" || "POST_TEST_TRAFFIC_SHIFT" || "PRODUCTION_TRAFFIC_SHIFT" || "POST_PRODUCTION_TRAFFIC_SHIFT",
114114
* // ],
115+
* // hookDetails: "DOCUMENT_VALUE",
115116
* // },
116117
* // ],
117118
* // },

clients/client-ecs/src/commands/UpdateServiceCommand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ export interface UpdateServiceCommandOutput extends UpdateServiceResponse, __Met
186186
* lifecycleStages: [ // DeploymentLifecycleHookStageList
187187
* "RECONCILE_SERVICE" || "PRE_SCALE_UP" || "POST_SCALE_UP" || "TEST_TRAFFIC_SHIFT" || "POST_TEST_TRAFFIC_SHIFT" || "PRODUCTION_TRAFFIC_SHIFT" || "POST_PRODUCTION_TRAFFIC_SHIFT",
188188
* ],
189+
* hookDetails: "DOCUMENT_VALUE",
189190
* },
190191
* ],
191192
* },
@@ -396,6 +397,7 @@ export interface UpdateServiceCommandOutput extends UpdateServiceResponse, __Met
396397
* // lifecycleStages: [ // DeploymentLifecycleHookStageList
397398
* // "RECONCILE_SERVICE" || "PRE_SCALE_UP" || "POST_SCALE_UP" || "TEST_TRAFFIC_SHIFT" || "POST_TEST_TRAFFIC_SHIFT" || "PRODUCTION_TRAFFIC_SHIFT" || "POST_PRODUCTION_TRAFFIC_SHIFT",
398399
* // ],
400+
* // hookDetails: "DOCUMENT_VALUE",
399401
* // },
400402
* // ],
401403
* // },

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// smithy-typescript generated code
22
import { ExceptionOptionType as __ExceptionOptionType, SENSITIVE_STRING } from "@smithy/smithy-client";
33

4+
import { DocumentType as __DocumentType } from "@smithy/types";
5+
46
import { ECSServiceException as __BaseException } from "./ECSServiceException";
57

68
/**
@@ -1573,6 +1575,12 @@ export interface DeploymentLifecycleHook {
15731575
* @public
15741576
*/
15751577
lifecycleStages?: DeploymentLifecycleHookStage[] | undefined;
1578+
1579+
/**
1580+
* <p>Use this field to specify custom parameters that Amazon ECS will pass to your hook target invocations (such as a Lambda function).</p>
1581+
* @public
1582+
*/
1583+
hookDetails?: __DocumentType | undefined;
15761584
}
15771585

15781586
/**
@@ -3201,7 +3209,7 @@ export interface CreateServiceRequest {
32013209
* <p>The default behavior of <code>AvailabilityZoneRebalancing</code> differs between create and update requests:</p>
32023210
* <ul>
32033211
* <li>
3204-
* <p>For create service requests, when when no value is specified for <code>AvailabilityZoneRebalancing</code>, Amazon ECS defaults the value to to <code>ENABLED</code>.</p>
3212+
* <p>For create service requests, when no value is specified for <code>AvailabilityZoneRebalancing</code>, Amazon ECS defaults the value to <code>ENABLED</code>.</p>
32053213
* </li>
32063214
* <li>
32073215
* <p>For update service requests, when no value is specified for <code>AvailabilityZoneRebalancing</code>, Amazon ECS defaults to the existing service’s <code>AvailabilityZoneRebalancing</code> value. If the service never had an <code>AvailabilityZoneRebalancing</code> value set, Amazon ECS treats this as <code>DISABLED</code>.</p>
@@ -4380,7 +4388,7 @@ export interface Service {
43804388
* <p>The default behavior of <code>AvailabilityZoneRebalancing</code> differs between create and update requests:</p>
43814389
* <ul>
43824390
* <li>
4383-
* <p>For create service requests, when when no value is specified for <code>AvailabilityZoneRebalancing</code>, Amazon ECS defaults the value to to <code>ENABLED</code>.</p>
4391+
* <p>For create service requests, when no value is specified for <code>AvailabilityZoneRebalancing</code>, Amazon ECS defaults the value to <code>ENABLED</code>.</p>
43844392
* </li>
43854393
* <li>
43864394
* <p>For update service requests, when no value is specified for <code>AvailabilityZoneRebalancing</code>, Amazon ECS defaults to the existing service’s <code>AvailabilityZoneRebalancing</code> value. If the service never had an <code>AvailabilityZoneRebalancing</code> value set, Amazon ECS treats this as <code>DISABLED</code>.</p>
@@ -6535,7 +6543,7 @@ export interface ContainerDefinition {
65356543
* <p>Port mappings on Windows use the <code>NetNAT</code> gateway address rather than
65366544
* <code>localhost</code>. There's no loopback for port mappings on Windows, so you
65376545
* can't access a container's mapped port from the host itself. </p>
6538-
* <p>This parameter maps to <code>PortBindings</code> in the the docker container create
6546+
* <p>This parameter maps to <code>PortBindings</code> in the docker container create
65396547
* command and the <code>--publish</code> option to docker run. If the network mode of a
65406548
* task definition is set to <code>none</code>, then you can't specify port mappings. If
65416549
* the network mode of a task definition is set to <code>host</code>, then host ports must
@@ -13230,7 +13238,7 @@ export interface RunTaskRequest {
1323013238

1323113239
/**
1323213240
* <p>The details of the volume that was <code>configuredAtLaunch</code>. You can configure
13233-
* the size, volumeType, IOPS, throughput, snapshot and encryption in in <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TaskManagedEBSVolumeConfiguration.html">TaskManagedEBSVolumeConfiguration</a>. The <code>name</code> of the volume must
13241+
* the size, volumeType, IOPS, throughput, snapshot and encryption in <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TaskManagedEBSVolumeConfiguration.html">TaskManagedEBSVolumeConfiguration</a>. The <code>name</code> of the volume must
1323413242
* match the <code>name</code> from the task definition.</p>
1323513243
* @public
1323613244
*/

clients/client-ecs/src/models/models_1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ export interface UpdateServiceRequest {
767767
* <p>The default behavior of <code>AvailabilityZoneRebalancing</code> differs between create and update requests:</p>
768768
* <ul>
769769
* <li>
770-
* <p>For create service requests, when when no value is specified for <code>AvailabilityZoneRebalancing</code>, Amazon ECS defaults the value to to <code>ENABLED</code>.</p>
770+
* <p>For create service requests, when no value is specified for <code>AvailabilityZoneRebalancing</code>, Amazon ECS defaults the value to <code>ENABLED</code>.</p>
771771
* </li>
772772
* <li>
773773
* <p>For update service requests, when no value is specified for <code>AvailabilityZoneRebalancing</code>, Amazon ECS defaults to the existing service’s <code>AvailabilityZoneRebalancing</code> value. If the service never had an <code>AvailabilityZoneRebalancing</code> value set, Amazon ECS treats this as <code>DISABLED</code>.</p>

clients/client-ecs/src/protocols/Aws_json1_1.ts

Lines changed: 152 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
withBaseException,
1919
} from "@smithy/smithy-client";
2020
import {
21+
DocumentType as __DocumentType,
2122
Endpoint as __Endpoint,
2223
HeaderBag as __HeaderBag,
2324
ResponseMetadata as __ResponseMetadata,
@@ -451,7 +452,7 @@ export const se_CreateServiceCommand = async (
451452
): Promise<__HttpRequest> => {
452453
const headers: __HeaderBag = sharedHeaders("CreateService");
453454
let body: any;
454-
body = JSON.stringify(_json(input));
455+
body = JSON.stringify(se_CreateServiceRequest(input, context));
455456
return buildHttpRpcRequest(context, headers, "/", undefined, body);
456457
};
457458

@@ -1153,7 +1154,7 @@ export const se_UpdateServiceCommand = async (
11531154
): Promise<__HttpRequest> => {
11541155
const headers: __HeaderBag = sharedHeaders("UpdateService");
11551156
let body: any;
1156-
body = JSON.stringify(_json(input));
1157+
body = JSON.stringify(se_UpdateServiceRequest(input, context));
11571158
return buildHttpRpcRequest(context, headers, "/", undefined, body);
11581159
};
11591160

@@ -2985,7 +2986,39 @@ const se_CreatedAt = (input: CreatedAt, context: __SerdeContext): any => {
29852986
});
29862987
};
29872988

2988-
// se_CreateServiceRequest omitted.
2989+
/**
2990+
* serializeAws_json1_1CreateServiceRequest
2991+
*/
2992+
const se_CreateServiceRequest = (input: CreateServiceRequest, context: __SerdeContext): any => {
2993+
return take(input, {
2994+
availabilityZoneRebalancing: [],
2995+
capacityProviderStrategy: _json,
2996+
clientToken: [],
2997+
cluster: [],
2998+
deploymentConfiguration: (_) => se_DeploymentConfiguration(_, context),
2999+
deploymentController: _json,
3000+
desiredCount: [],
3001+
enableECSManagedTags: [],
3002+
enableExecuteCommand: [],
3003+
healthCheckGracePeriodSeconds: [],
3004+
launchType: [],
3005+
loadBalancers: _json,
3006+
networkConfiguration: _json,
3007+
placementConstraints: _json,
3008+
placementStrategy: _json,
3009+
platformVersion: [],
3010+
propagateTags: [],
3011+
role: [],
3012+
schedulingStrategy: [],
3013+
serviceConnectConfiguration: _json,
3014+
serviceName: [],
3015+
serviceRegistries: _json,
3016+
tags: _json,
3017+
taskDefinition: [],
3018+
volumeConfigurations: _json,
3019+
vpcLatticeConfigurations: _json,
3020+
});
3021+
};
29893022

29903023
/**
29913024
* serializeAws_json1_1CreateTaskSetRequest
@@ -3026,13 +3059,45 @@ const se_CreateTaskSetRequest = (input: CreateTaskSetRequest, context: __SerdeCo
30263059

30273060
// se_DeploymentCircuitBreaker omitted.
30283061

3029-
// se_DeploymentConfiguration omitted.
3062+
/**
3063+
* serializeAws_json1_1DeploymentConfiguration
3064+
*/
3065+
const se_DeploymentConfiguration = (input: DeploymentConfiguration, context: __SerdeContext): any => {
3066+
return take(input, {
3067+
alarms: _json,
3068+
bakeTimeInMinutes: [],
3069+
deploymentCircuitBreaker: _json,
3070+
lifecycleHooks: (_) => se_DeploymentLifecycleHookList(_, context),
3071+
maximumPercent: [],
3072+
minimumHealthyPercent: [],
3073+
strategy: [],
3074+
});
3075+
};
30303076

30313077
// se_DeploymentController omitted.
30323078

3033-
// se_DeploymentLifecycleHook omitted.
3079+
/**
3080+
* serializeAws_json1_1DeploymentLifecycleHook
3081+
*/
3082+
const se_DeploymentLifecycleHook = (input: DeploymentLifecycleHook, context: __SerdeContext): any => {
3083+
return take(input, {
3084+
hookDetails: (_) => se_HookDetails(_, context),
3085+
hookTargetArn: [],
3086+
lifecycleStages: _json,
3087+
roleArn: [],
3088+
});
3089+
};
30343090

3035-
// se_DeploymentLifecycleHookList omitted.
3091+
/**
3092+
* serializeAws_json1_1DeploymentLifecycleHookList
3093+
*/
3094+
const se_DeploymentLifecycleHookList = (input: DeploymentLifecycleHook[], context: __SerdeContext): any => {
3095+
return input
3096+
.filter((e: any) => e != null)
3097+
.map((entry) => {
3098+
return se_DeploymentLifecycleHook(entry, context);
3099+
});
3100+
};
30363101

30373102
// se_DeploymentLifecycleHookStageList omitted.
30383103

@@ -3104,6 +3169,13 @@ const se_CreateTaskSetRequest = (input: CreateTaskSetRequest, context: __SerdeCo
31043169

31053170
// se_HealthCheck omitted.
31063171

3172+
/**
3173+
* serializeAws_json1_1HookDetails
3174+
*/
3175+
const se_HookDetails = (input: __DocumentType, context: __SerdeContext): any => {
3176+
return input;
3177+
};
3178+
31073179
// se_HostEntry omitted.
31083180

31093181
// se_HostEntryList omitted.
@@ -3429,7 +3501,35 @@ const se_SubmitTaskStateChangeRequest = (input: SubmitTaskStateChangeRequest, co
34293501

34303502
// se_UpdateServicePrimaryTaskSetRequest omitted.
34313503

3432-
// se_UpdateServiceRequest omitted.
3504+
/**
3505+
* serializeAws_json1_1UpdateServiceRequest
3506+
*/
3507+
const se_UpdateServiceRequest = (input: UpdateServiceRequest, context: __SerdeContext): any => {
3508+
return take(input, {
3509+
availabilityZoneRebalancing: [],
3510+
capacityProviderStrategy: _json,
3511+
cluster: [],
3512+
deploymentConfiguration: (_) => se_DeploymentConfiguration(_, context),
3513+
deploymentController: _json,
3514+
desiredCount: [],
3515+
enableECSManagedTags: [],
3516+
enableExecuteCommand: [],
3517+
forceNewDeployment: [],
3518+
healthCheckGracePeriodSeconds: [],
3519+
loadBalancers: _json,
3520+
networkConfiguration: _json,
3521+
placementConstraints: _json,
3522+
placementStrategy: _json,
3523+
platformVersion: [],
3524+
propagateTags: [],
3525+
service: [],
3526+
serviceConnectConfiguration: _json,
3527+
serviceRegistries: _json,
3528+
taskDefinition: [],
3529+
volumeConfigurations: _json,
3530+
vpcLatticeConfigurations: _json,
3531+
});
3532+
};
34333533

34343534
// se_UpdateTaskProtectionRequest omitted.
34353535

@@ -3709,15 +3809,48 @@ const de_Deployment = (output: any, context: __SerdeContext): Deployment => {
37093809

37103810
// de_DeploymentCircuitBreaker omitted.
37113811

3712-
// de_DeploymentConfiguration omitted.
3812+
/**
3813+
* deserializeAws_json1_1DeploymentConfiguration
3814+
*/
3815+
const de_DeploymentConfiguration = (output: any, context: __SerdeContext): DeploymentConfiguration => {
3816+
return take(output, {
3817+
alarms: _json,
3818+
bakeTimeInMinutes: __expectInt32,
3819+
deploymentCircuitBreaker: _json,
3820+
lifecycleHooks: (_: any) => de_DeploymentLifecycleHookList(_, context),
3821+
maximumPercent: __expectInt32,
3822+
minimumHealthyPercent: __expectInt32,
3823+
strategy: __expectString,
3824+
}) as any;
3825+
};
37133826

37143827
// de_DeploymentController omitted.
37153828

37163829
// de_DeploymentEphemeralStorage omitted.
37173830

3718-
// de_DeploymentLifecycleHook omitted.
3831+
/**
3832+
* deserializeAws_json1_1DeploymentLifecycleHook
3833+
*/
3834+
const de_DeploymentLifecycleHook = (output: any, context: __SerdeContext): DeploymentLifecycleHook => {
3835+
return take(output, {
3836+
hookDetails: (_: any) => de_HookDetails(_, context),
3837+
hookTargetArn: __expectString,
3838+
lifecycleStages: _json,
3839+
roleArn: __expectString,
3840+
}) as any;
3841+
};
37193842

3720-
// de_DeploymentLifecycleHookList omitted.
3843+
/**
3844+
* deserializeAws_json1_1DeploymentLifecycleHookList
3845+
*/
3846+
const de_DeploymentLifecycleHookList = (output: any, context: __SerdeContext): DeploymentLifecycleHook[] => {
3847+
const retVal = (output || [])
3848+
.filter((e: any) => e != null)
3849+
.map((entry: any) => {
3850+
return de_DeploymentLifecycleHook(entry, context);
3851+
});
3852+
return retVal;
3853+
};
37213854

37223855
// de_DeploymentLifecycleHookStageList omitted.
37233856

@@ -3900,6 +4033,13 @@ const de_GetTaskProtectionResponse = (output: any, context: __SerdeContext): Get
39004033

39014034
// de_HealthCheck omitted.
39024035

4036+
/**
4037+
* deserializeAws_json1_1HookDetails
4038+
*/
4039+
const de_HookDetails = (output: any, context: __SerdeContext): __DocumentType => {
4040+
return output;
4041+
};
4042+
39034043
// de_HostEntry omitted.
39044044

39054045
// de_HostEntryList omitted.
@@ -4200,7 +4340,7 @@ const de_Service = (output: any, context: __SerdeContext): Service => {
42004340
clusterArn: __expectString,
42014341
createdAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
42024342
createdBy: __expectString,
4203-
deploymentConfiguration: _json,
4343+
deploymentConfiguration: (_: any) => de_DeploymentConfiguration(_, context),
42044344
deploymentController: _json,
42054345
deployments: (_: any) => de_Deployments(_, context),
42064346
desiredCount: __expectInt32,
@@ -4263,7 +4403,7 @@ const de_ServiceDeployment = (output: any, context: __SerdeContext): ServiceDepl
42634403
clusterArn: __expectString,
42644404
createdAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
42654405
deploymentCircuitBreaker: _json,
4266-
deploymentConfiguration: _json,
4406+
deploymentConfiguration: (_: any) => de_DeploymentConfiguration(_, context),
42674407
finishedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
42684408
lifecycleStage: __expectString,
42694409
rollback: (_: any) => de_Rollback(_, context),

0 commit comments

Comments
 (0)