Skip to content

Commit b3df65a

Browse files
author
awstools
committed
feat(client-emr): Update APIs to allow modification of ODCR options, allocation strategy, and InstanceTypeConfigs on running InstanceFleet clusters.
1 parent b2fefb3 commit b3df65a

File tree

7 files changed

+245
-85
lines changed

7 files changed

+245
-85
lines changed

clients/client-emr/src/commands/AddInstanceFleetCommand.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,17 @@ export interface AddInstanceFleetCommandOutput extends AddInstanceFleetOutput, _
105105
* },
106106
* ResizeSpecifications: { // InstanceFleetResizingSpecifications
107107
* SpotResizeSpecification: { // SpotResizingSpecification
108-
* TimeoutDurationMinutes: Number("int"), // required
108+
* TimeoutDurationMinutes: Number("int"),
109+
* AllocationStrategy: "capacity-optimized" || "price-capacity-optimized" || "lowest-price" || "diversified" || "capacity-optimized-prioritized",
109110
* },
110111
* OnDemandResizeSpecification: { // OnDemandResizingSpecification
111-
* TimeoutDurationMinutes: Number("int"), // required
112+
* TimeoutDurationMinutes: Number("int"),
113+
* AllocationStrategy: "lowest-price" || "prioritized",
114+
* CapacityReservationOptions: {
115+
* UsageStrategy: "use-capacity-reservations-first",
116+
* CapacityReservationPreference: "open" || "none",
117+
* CapacityReservationResourceGroupArn: "STRING_VALUE",
118+
* },
112119
* },
113120
* },
114121
* },

clients/client-emr/src/commands/ListInstanceFleetsCommand.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,17 @@ export interface ListInstanceFleetsCommandOutput extends ListInstanceFleetsOutpu
124124
* // },
125125
* // ResizeSpecifications: { // InstanceFleetResizingSpecifications
126126
* // SpotResizeSpecification: { // SpotResizingSpecification
127-
* // TimeoutDurationMinutes: Number("int"), // required
127+
* // TimeoutDurationMinutes: Number("int"),
128+
* // AllocationStrategy: "capacity-optimized" || "price-capacity-optimized" || "lowest-price" || "diversified" || "capacity-optimized-prioritized",
128129
* // },
129130
* // OnDemandResizeSpecification: { // OnDemandResizingSpecification
130-
* // TimeoutDurationMinutes: Number("int"), // required
131+
* // TimeoutDurationMinutes: Number("int"),
132+
* // AllocationStrategy: "lowest-price" || "prioritized",
133+
* // CapacityReservationOptions: {
134+
* // UsageStrategy: "use-capacity-reservations-first",
135+
* // CapacityReservationPreference: "open" || "none",
136+
* // CapacityReservationResourceGroupArn: "STRING_VALUE",
137+
* // },
131138
* // },
132139
* // },
133140
* // },

clients/client-emr/src/commands/ModifyInstanceFleetCommand.ts

+50-2
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,60 @@ export interface ModifyInstanceFleetCommandOutput extends __MetadataBearer {}
4949
* TargetSpotCapacity: Number("int"),
5050
* ResizeSpecifications: { // InstanceFleetResizingSpecifications
5151
* SpotResizeSpecification: { // SpotResizingSpecification
52-
* TimeoutDurationMinutes: Number("int"), // required
52+
* TimeoutDurationMinutes: Number("int"),
53+
* AllocationStrategy: "capacity-optimized" || "price-capacity-optimized" || "lowest-price" || "diversified" || "capacity-optimized-prioritized",
5354
* },
5455
* OnDemandResizeSpecification: { // OnDemandResizingSpecification
55-
* TimeoutDurationMinutes: Number("int"), // required
56+
* TimeoutDurationMinutes: Number("int"),
57+
* AllocationStrategy: "lowest-price" || "prioritized",
58+
* CapacityReservationOptions: { // OnDemandCapacityReservationOptions
59+
* UsageStrategy: "use-capacity-reservations-first",
60+
* CapacityReservationPreference: "open" || "none",
61+
* CapacityReservationResourceGroupArn: "STRING_VALUE",
62+
* },
5663
* },
5764
* },
65+
* InstanceTypeConfigs: [ // InstanceTypeConfigList
66+
* { // InstanceTypeConfig
67+
* InstanceType: "STRING_VALUE", // required
68+
* WeightedCapacity: Number("int"),
69+
* BidPrice: "STRING_VALUE",
70+
* BidPriceAsPercentageOfOnDemandPrice: Number("double"),
71+
* EbsConfiguration: { // EbsConfiguration
72+
* EbsBlockDeviceConfigs: [ // EbsBlockDeviceConfigList
73+
* { // EbsBlockDeviceConfig
74+
* VolumeSpecification: { // VolumeSpecification
75+
* VolumeType: "STRING_VALUE", // required
76+
* Iops: Number("int"),
77+
* SizeInGB: Number("int"), // required
78+
* Throughput: Number("int"),
79+
* },
80+
* VolumesPerInstance: Number("int"),
81+
* },
82+
* ],
83+
* EbsOptimized: true || false,
84+
* },
85+
* Configurations: [ // ConfigurationList
86+
* { // Configuration
87+
* Classification: "STRING_VALUE",
88+
* Configurations: [
89+
* {
90+
* Classification: "STRING_VALUE",
91+
* Configurations: "<ConfigurationList>",
92+
* Properties: { // StringMap
93+
* "<keys>": "STRING_VALUE",
94+
* },
95+
* },
96+
* ],
97+
* Properties: {
98+
* "<keys>": "STRING_VALUE",
99+
* },
100+
* },
101+
* ],
102+
* CustomAmiId: "STRING_VALUE",
103+
* Priority: Number("double"),
104+
* },
105+
* ],
58106
* },
59107
* };
60108
* const command = new ModifyInstanceFleetCommand(input);

clients/client-emr/src/commands/RunJobFlowCommand.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,17 @@ export interface RunJobFlowCommandOutput extends RunJobFlowOutput, __MetadataBea
196196
* },
197197
* ResizeSpecifications: { // InstanceFleetResizingSpecifications
198198
* SpotResizeSpecification: { // SpotResizingSpecification
199-
* TimeoutDurationMinutes: Number("int"), // required
199+
* TimeoutDurationMinutes: Number("int"),
200+
* AllocationStrategy: "capacity-optimized" || "price-capacity-optimized" || "lowest-price" || "diversified" || "capacity-optimized-prioritized",
200201
* },
201202
* OnDemandResizeSpecification: { // OnDemandResizingSpecification
202-
* TimeoutDurationMinutes: Number("int"), // required
203+
* TimeoutDurationMinutes: Number("int"),
204+
* AllocationStrategy: "lowest-price" || "prioritized",
205+
* CapacityReservationOptions: {
206+
* UsageStrategy: "use-capacity-reservations-first",
207+
* CapacityReservationPreference: "open" || "none",
208+
* CapacityReservationResourceGroupArn: "STRING_VALUE",
209+
* },
203210
* },
204211
* },
205212
* },

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

+89-62
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,7 @@ export interface SpotProvisioningSpecification {
332332
}
333333

334334
/**
335-
* <p>The launch specification for Spot Instances in the fleet, which determines the defined
336-
* duration, provisioning timeout behavior, and allocation strategy.</p>
335+
* <p>The launch specification for On-Demand and Spot Instances in the fleet.</p>
337336
* <note>
338337
* <p>The instance fleet configuration is available only in Amazon EMR releases
339338
* 4.8.0 and later, excluding 5.0.x versions. On-Demand and Spot instance allocation
@@ -343,15 +342,15 @@ export interface SpotProvisioningSpecification {
343342
*/
344343
export interface InstanceFleetProvisioningSpecifications {
345344
/**
346-
* <p>The launch specification for Spot instances in the fleet, which determines the defined
347-
* duration, provisioning timeout behavior, and allocation strategy.</p>
345+
* <p>The launch specification for Spot instances in the fleet, which determines the allocation strategy, defined
346+
* duration, and provisioning timeout behavior.</p>
348347
* @public
349348
*/
350349
SpotSpecification?: SpotProvisioningSpecification;
351350

352351
/**
353352
* <p> The launch specification for On-Demand Instances in the instance fleet, which
354-
* determines the allocation strategy. </p>
353+
* determines the allocation strategy and capacity reservation options.</p>
355354
* <note>
356355
* <p>The instance fleet configuration is available only in Amazon EMR releases
357356
* 4.8.0 and later, excluding 5.0.x versions. On-Demand Instances allocation strategy is
@@ -377,7 +376,20 @@ export interface OnDemandResizingSpecification {
377376
* Amazon EMR SDK ModifyInstanceFleet API) or by Amazon EMR due to Amazon EC2 Spot Reclamation.</p>
378377
* @public
379378
*/
380-
TimeoutDurationMinutes: number | undefined;
379+
TimeoutDurationMinutes?: number;
380+
381+
/**
382+
* <p>Specifies the allocation strategy to use to launch On-Demand instances during a resize. The default is <code>lowest-price</code>.</p>
383+
* @public
384+
*/
385+
AllocationStrategy?: OnDemandProvisioningAllocationStrategy;
386+
387+
/**
388+
* <p>Describes the strategy for using unused Capacity Reservations for fulfilling On-Demand
389+
* capacity.</p>
390+
* @public
391+
*/
392+
CapacityReservationOptions?: OnDemandCapacityReservationOptions;
381393
}
382394

383395
/**
@@ -395,7 +407,15 @@ export interface SpotResizingSpecification {
395407
* modify-instance-fleet or Amazon EMR SDK ModifyInstanceFleet API) or by Amazon EMR due to Amazon EC2 Spot Reclamation.</p>
396408
* @public
397409
*/
398-
TimeoutDurationMinutes: number | undefined;
410+
TimeoutDurationMinutes?: number;
411+
412+
/**
413+
* <p>Specifies the allocation strategy to use to launch Spot instances during a resize. If you run Amazon EMR releases 6.9.0 or higher,
414+
* the default is <code>price-capacity-optimized</code>. If you run Amazon EMR releases 6.8.0 or lower, the default is
415+
* <code>capacity-optimized</code>.</p>
416+
* @public
417+
*/
418+
AllocationStrategy?: SpotProvisioningAllocationStrategy;
399419
}
400420

401421
/**
@@ -405,14 +425,14 @@ export interface SpotResizingSpecification {
405425
export interface InstanceFleetResizingSpecifications {
406426
/**
407427
* <p>The resize specification for Spot Instances in the instance fleet, which contains the
408-
* resize timeout period. </p>
428+
* allocation strategy and the resize timeout period. </p>
409429
* @public
410430
*/
411431
SpotResizeSpecification?: SpotResizingSpecification;
412432

413433
/**
414434
* <p>The resize specification for On-Demand Instances in the instance fleet, which contains
415-
* the resize timeout period. </p>
435+
* the allocation strategy, capacity reservation options, and the resize timeout period. </p>
416436
* @public
417437
*/
418438
OnDemandResizeSpecification?: OnDemandResizingSpecification;
@@ -5446,59 +5466,6 @@ export interface ModifyClusterOutput {
54465466
StepConcurrencyLevel?: number;
54475467
}
54485468

5449-
/**
5450-
* <p>Configuration parameters for an instance fleet modification request.</p>
5451-
* <note>
5452-
* <p>The instance fleet configuration is available only in Amazon EMR releases
5453-
* 4.8.0 and later, excluding 5.0.x versions.</p>
5454-
* </note>
5455-
* @public
5456-
*/
5457-
export interface InstanceFleetModifyConfig {
5458-
/**
5459-
* <p>A unique identifier for the instance fleet.</p>
5460-
* @public
5461-
*/
5462-
InstanceFleetId: string | undefined;
5463-
5464-
/**
5465-
* <p>The target capacity of On-Demand units for the instance fleet. For more information see
5466-
* <a>InstanceFleetConfig$TargetOnDemandCapacity</a>.</p>
5467-
* @public
5468-
*/
5469-
TargetOnDemandCapacity?: number;
5470-
5471-
/**
5472-
* <p>The target capacity of Spot units for the instance fleet. For more information, see
5473-
* <a>InstanceFleetConfig$TargetSpotCapacity</a>.</p>
5474-
* @public
5475-
*/
5476-
TargetSpotCapacity?: number;
5477-
5478-
/**
5479-
* <p>The resize specification for the instance fleet.</p>
5480-
* @public
5481-
*/
5482-
ResizeSpecifications?: InstanceFleetResizingSpecifications;
5483-
}
5484-
5485-
/**
5486-
* @public
5487-
*/
5488-
export interface ModifyInstanceFleetInput {
5489-
/**
5490-
* <p>The unique identifier of the cluster.</p>
5491-
* @public
5492-
*/
5493-
ClusterId: string | undefined;
5494-
5495-
/**
5496-
* <p>The configuration parameters of the instance fleet.</p>
5497-
* @public
5498-
*/
5499-
InstanceFleet: InstanceFleetModifyConfig | undefined;
5500-
}
5501-
55025469
/**
55035470
* @public
55045471
* @enum
@@ -6981,6 +6948,49 @@ export interface InstanceFleetConfig {
69816948
ResizeSpecifications?: InstanceFleetResizingSpecifications;
69826949
}
69836950

6951+
/**
6952+
* <p>Configuration parameters for an instance fleet modification request.</p>
6953+
* <note>
6954+
* <p>The instance fleet configuration is available only in Amazon EMR releases
6955+
* 4.8.0 and later, excluding 5.0.x versions.</p>
6956+
* </note>
6957+
* @public
6958+
*/
6959+
export interface InstanceFleetModifyConfig {
6960+
/**
6961+
* <p>A unique identifier for the instance fleet.</p>
6962+
* @public
6963+
*/
6964+
InstanceFleetId: string | undefined;
6965+
6966+
/**
6967+
* <p>The target capacity of On-Demand units for the instance fleet. For more information see
6968+
* <a>InstanceFleetConfig$TargetOnDemandCapacity</a>.</p>
6969+
* @public
6970+
*/
6971+
TargetOnDemandCapacity?: number;
6972+
6973+
/**
6974+
* <p>The target capacity of Spot units for the instance fleet. For more information, see
6975+
* <a>InstanceFleetConfig$TargetSpotCapacity</a>.</p>
6976+
* @public
6977+
*/
6978+
TargetSpotCapacity?: number;
6979+
6980+
/**
6981+
* <p>The resize specification for the instance fleet.</p>
6982+
* @public
6983+
*/
6984+
ResizeSpecifications?: InstanceFleetResizingSpecifications;
6985+
6986+
/**
6987+
* <p>An array of InstanceTypeConfig objects that specify how Amazon EMR provisions Amazon EC2 instances
6988+
* when it fulfills On-Demand and Spot capacities. For more information, see <a href="https://docs.aws.amazon.com/emr/latest/APIReference/API_InstanceTypeConfig.html">InstanceTypeConfig</a>.</p>
6989+
* @public
6990+
*/
6991+
InstanceTypeConfigs?: InstanceTypeConfig[];
6992+
}
6993+
69846994
/**
69856995
* <p>Change the size of some instance groups.</p>
69866996
* @public
@@ -7146,6 +7156,23 @@ export interface InstanceGroup {
71467156
CustomAmiId?: string;
71477157
}
71487158

7159+
/**
7160+
* @public
7161+
*/
7162+
export interface ModifyInstanceFleetInput {
7163+
/**
7164+
* <p>The unique identifier of the cluster.</p>
7165+
* @public
7166+
*/
7167+
ClusterId: string | undefined;
7168+
7169+
/**
7170+
* <p>The configuration parameters of the instance fleet.</p>
7171+
* @public
7172+
*/
7173+
InstanceFleet: InstanceFleetModifyConfig | undefined;
7174+
}
7175+
71497176
/**
71507177
* @public
71517178
*/

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

+22-3
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ export const se_ModifyInstanceFleetCommand = async (
832832
): Promise<__HttpRequest> => {
833833
const headers: __HeaderBag = sharedHeaders("ModifyInstanceFleet");
834834
let body: any;
835-
body = JSON.stringify(_json(input));
835+
body = JSON.stringify(se_ModifyInstanceFleetInput(input, context));
836836
return buildHttpRpcRequest(context, headers, "/", undefined, body);
837837
};
838838

@@ -2428,7 +2428,18 @@ const se_InstanceFleetConfigList = (input: InstanceFleetConfig[], context: __Ser
24282428
});
24292429
};
24302430

2431-
// se_InstanceFleetModifyConfig omitted.
2431+
/**
2432+
* serializeAws_json1_1InstanceFleetModifyConfig
2433+
*/
2434+
const se_InstanceFleetModifyConfig = (input: InstanceFleetModifyConfig, context: __SerdeContext): any => {
2435+
return take(input, {
2436+
InstanceFleetId: [],
2437+
InstanceTypeConfigs: (_) => se_InstanceTypeConfigList(_, context),
2438+
ResizeSpecifications: _json,
2439+
TargetOnDemandCapacity: [],
2440+
TargetSpotCapacity: [],
2441+
});
2442+
};
24322443

24332444
// se_InstanceFleetProvisioningSpecifications omitted.
24342445

@@ -2609,7 +2620,15 @@ const se_ListNotebookExecutionsInput = (input: ListNotebookExecutionsInput, cont
26092620

26102621
// se_ModifyClusterInput omitted.
26112622

2612-
// se_ModifyInstanceFleetInput omitted.
2623+
/**
2624+
* serializeAws_json1_1ModifyInstanceFleetInput
2625+
*/
2626+
const se_ModifyInstanceFleetInput = (input: ModifyInstanceFleetInput, context: __SerdeContext): any => {
2627+
return take(input, {
2628+
ClusterId: [],
2629+
InstanceFleet: (_) => se_InstanceFleetModifyConfig(_, context),
2630+
});
2631+
};
26132632

26142633
/**
26152634
* serializeAws_json1_1ModifyInstanceGroupsInput

0 commit comments

Comments
 (0)