Skip to content

Commit 751c797

Browse files
author
awstools
committed
feat(client-ecs): Adding support for Event Windows via a new ECS account setting "fargateEventWindows". When enabled, ECS Fargate will use the configured event window for patching tasks. Introducing "CapacityOptionType" for CreateCapacityProvider API, allowing support for Spot capacity for ECS Managed Instances.
1 parent 406035c commit 751c797

14 files changed

+108
-11
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export interface CreateCapacityProviderCommandOutput extends CreateCapacityProvi
7070
* storageSizeGiB: Number("int"),
7171
* },
7272
* monitoring: "BASIC" || "DETAILED",
73+
* capacityOptionType: "ON_DEMAND" || "SPOT",
7374
* instanceRequirements: { // InstanceRequirementsRequest
7475
* vCpuCount: { // VCpuCountRangeRequest
7576
* min: Number("int"), // required
@@ -188,6 +189,7 @@ export interface CreateCapacityProviderCommandOutput extends CreateCapacityProvi
188189
* // storageSizeGiB: Number("int"),
189190
* // },
190191
* // monitoring: "BASIC" || "DETAILED",
192+
* // capacityOptionType: "ON_DEMAND" || "SPOT",
191193
* // instanceRequirements: { // InstanceRequirementsRequest
192194
* // vCpuCount: { // VCpuCountRangeRequest
193195
* // min: Number("int"), // required

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ export interface DeleteAccountSettingCommandOutput extends DeleteAccountSettingR
3838
* const config = {}; // type is ECSClientConfig
3939
* const client = new ECSClient(config);
4040
* const input = { // DeleteAccountSettingRequest
41-
* name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode", // required
41+
* name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode" || "fargateEventWindows", // required
4242
* principalArn: "STRING_VALUE",
4343
* };
4444
* const command = new DeleteAccountSettingCommand(input);
4545
* const response = await client.send(command);
4646
* // { // DeleteAccountSettingResponse
4747
* // setting: { // Setting
48-
* // name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode",
48+
* // name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode" || "fargateEventWindows",
4949
* // value: "STRING_VALUE",
5050
* // principalArn: "STRING_VALUE",
5151
* // type: "user" || "aws_managed",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export interface DeleteCapacityProviderCommandOutput extends DeleteCapacityProvi
8989
* // storageSizeGiB: Number("int"),
9090
* // },
9191
* // monitoring: "BASIC" || "DETAILED",
92+
* // capacityOptionType: "ON_DEMAND" || "SPOT",
9293
* // instanceRequirements: { // InstanceRequirementsRequest
9394
* // vCpuCount: { // VCpuCountRangeRequest
9495
* // min: Number("int"), // required

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export interface DescribeCapacityProvidersCommandOutput extends DescribeCapacity
8484
* // storageSizeGiB: Number("int"),
8585
* // },
8686
* // monitoring: "BASIC" || "DETAILED",
87+
* // capacityOptionType: "ON_DEMAND" || "SPOT",
8788
* // instanceRequirements: { // InstanceRequirementsRequest
8889
* // vCpuCount: { // VCpuCountRangeRequest
8990
* // min: Number("int"), // required

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export interface ListAccountSettingsCommandOutput extends ListAccountSettingsRes
3737
* const config = {}; // type is ECSClientConfig
3838
* const client = new ECSClient(config);
3939
* const input = { // ListAccountSettingsRequest
40-
* name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode",
40+
* name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode" || "fargateEventWindows",
4141
* value: "STRING_VALUE",
4242
* principalArn: "STRING_VALUE",
4343
* effectiveSettings: true || false,
@@ -49,7 +49,7 @@ export interface ListAccountSettingsCommandOutput extends ListAccountSettingsRes
4949
* // { // ListAccountSettingsResponse
5050
* // settings: [ // Settings
5151
* // { // Setting
52-
* // name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode",
52+
* // name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode" || "fargateEventWindows",
5353
* // value: "STRING_VALUE",
5454
* // principalArn: "STRING_VALUE",
5555
* // type: "user" || "aws_managed",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ export interface PutAccountSettingCommandOutput extends PutAccountSettingRespons
4242
* const config = {}; // type is ECSClientConfig
4343
* const client = new ECSClient(config);
4444
* const input = { // PutAccountSettingRequest
45-
* name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode", // required
45+
* name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode" || "fargateEventWindows", // required
4646
* value: "STRING_VALUE", // required
4747
* principalArn: "STRING_VALUE",
4848
* };
4949
* const command = new PutAccountSettingCommand(input);
5050
* const response = await client.send(command);
5151
* // { // PutAccountSettingResponse
5252
* // setting: { // Setting
53-
* // name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode",
53+
* // name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode" || "fargateEventWindows",
5454
* // value: "STRING_VALUE",
5555
* // principalArn: "STRING_VALUE",
5656
* // type: "user" || "aws_managed",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ export interface PutAccountSettingDefaultCommandOutput extends PutAccountSetting
3838
* const config = {}; // type is ECSClientConfig
3939
* const client = new ECSClient(config);
4040
* const input = { // PutAccountSettingDefaultRequest
41-
* name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode", // required
41+
* name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode" || "fargateEventWindows", // required
4242
* value: "STRING_VALUE", // required
4343
* };
4444
* const command = new PutAccountSettingDefaultCommand(input);
4545
* const response = await client.send(command);
4646
* // { // PutAccountSettingDefaultResponse
4747
* // setting: { // Setting
48-
* // name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode",
48+
* // name: "serviceLongArnFormat" || "taskLongArnFormat" || "containerInstanceLongArnFormat" || "awsvpcTrunking" || "containerInsights" || "fargateFIPSMode" || "tagResourceAuthorization" || "fargateTaskRetirementWaitPeriod" || "guardDutyActivate" || "defaultLogDriverMode" || "fargateEventWindows",
4949
* // value: "STRING_VALUE",
5050
* // principalArn: "STRING_VALUE",
5151
* // type: "user" || "aws_managed",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ export interface UpdateCapacityProviderCommandOutput extends UpdateCapacityProvi
180180
* // storageSizeGiB: Number("int"),
181181
* // },
182182
* // monitoring: "BASIC" || "DETAILED",
183+
* // capacityOptionType: "ON_DEMAND" || "SPOT",
183184
* // instanceRequirements: { // InstanceRequirementsRequest
184185
* // vCpuCount: { // VCpuCountRangeRequest
185186
* // min: Number("int"), // required

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,19 @@ export const ManagedTerminationProtection = {
122122
export type ManagedTerminationProtection =
123123
(typeof ManagedTerminationProtection)[keyof typeof ManagedTerminationProtection];
124124

125+
/**
126+
* @public
127+
* @enum
128+
*/
129+
export const CapacityOptionType = {
130+
ON_DEMAND: "ON_DEMAND",
131+
SPOT: "SPOT",
132+
} as const;
133+
/**
134+
* @public
135+
*/
136+
export type CapacityOptionType = (typeof CapacityOptionType)[keyof typeof CapacityOptionType];
137+
125138
/**
126139
* @public
127140
* @enum
@@ -617,6 +630,7 @@ export const SettingName = {
617630
CONTAINER_INSIGHTS: "containerInsights",
618631
CONTAINER_INSTANCE_LONG_ARN_FORMAT: "containerInstanceLongArnFormat",
619632
DEFAULT_LOG_DRIVER_MODE: "defaultLogDriverMode",
633+
FARGATE_EVENT_WINDOWS: "fargateEventWindows",
620634
FARGATE_FIPS_MODE: "fargateFIPSMode",
621635
FARGATE_TASK_RETIREMENT_WAIT_PERIOD: "fargateTaskRetirementWaitPeriod",
622636
GUARD_DUTY_ACTIVATE: "guardDutyActivate",

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

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
AvailabilityZoneRebalancing,
1313
BareMetal,
1414
BurstablePerformance,
15+
CapacityOptionType,
1516
CapacityProviderField,
1617
CapacityProviderStatus,
1718
CapacityProviderType,
@@ -735,6 +736,31 @@ export interface InstanceLaunchTemplate {
735736
*/
736737
monitoring?: ManagedInstancesMonitoringOptions | undefined;
737738

739+
/**
740+
* <p>The capacity option type. This determines whether
741+
* Amazon ECS launches On-Demand or Spot Instances for your managed instance
742+
* capacity provider.</p>
743+
* <p>Valid values are:</p>
744+
* <ul>
745+
* <li>
746+
* <p>
747+
* <code>ON_DEMAND</code> - Launches standard On-Demand Instances.
748+
* On-Demand Instances provide predictable pricing and availability.</p>
749+
* </li>
750+
* <li>
751+
* <p>
752+
* <code>SPOT</code> - Launches Spot Instances that use spare Amazon EC2 capacity
753+
* at reduced cost. Spot Instances can be interrupted by Amazon EC2 with a two-minute
754+
* notification when the capacity is needed back.</p>
755+
* </li>
756+
* </ul>
757+
* <p>The default is On-Demand</p>
758+
* <p>For more information about Amazon EC2 capacity options, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-purchasing-options.html">Instance purchasing
759+
* options</a> in the <i>Amazon EC2 User Guide</i>.</p>
760+
* @public
761+
*/
762+
capacityOptionType?: CapacityOptionType | undefined;
763+
738764
/**
739765
* <p>The instance requirements. You can specify:</p>
740766
* <ul>
@@ -12665,6 +12691,15 @@ export interface PutAccountSettingRequest {
1266512691
* </li>
1266612692
* <li>
1266712693
* <p>
12694+
* <code>fargateEventWindows</code> - When
12695+
* Amazon Web Services
12696+
* determines that a security or infrastructure update is needed for an Amazon ECS
12697+
* task hosted on Fargate, the tasks need to be stopped and new tasks launched to
12698+
* replace them. Use <code>fargateEventWindows</code> to use EC2 Event Windows associated
12699+
* with Fargate tasks to configure time windows for task retirement.</p>
12700+
* </li>
12701+
* <li>
12702+
* <p>
1266812703
* <code>tagResourceAuthorization</code> - Amazon ECS is introducing tagging
1266912704
* authorization for resource creation. Users must have permissions for actions
1267012705
* that create the resource, such as <code>ecsCreateCluster</code>. If tags are
@@ -12865,6 +12900,15 @@ export interface PutAccountSettingDefaultRequest {
1286512900
* </li>
1286612901
* <li>
1286712902
* <p>
12903+
* <code>fargateEventWindows</code> - When
12904+
* Amazon Web Services
12905+
* determines that a security or infrastructure update is needed for an Amazon ECS
12906+
* task hosted on Fargate, the tasks need to be stopped and new tasks launched to
12907+
* replace them. Use <code>fargateEventWindows</code> to use EC2 Event Windows associated
12908+
* with Fargate tasks to configure time windows for task retirement.</p>
12909+
* </li>
12910+
* <li>
12911+
* <p>
1286812912
* <code>tagResourceAuthorization</code> - Amazon ECS is introducing tagging
1286912913
* authorization for resource creation. Users must have permissions for actions
1287012914
* that create the resource, such as <code>ecsCreateCluster</code>. If tags are

0 commit comments

Comments
 (0)