Skip to content

Commit a29a5e4

Browse files
author
awstools
committed
feat(client-ec2): This release includes a new API for modifying instance cpu-options after launch.
1 parent a7f70be commit a29a5e4

17 files changed

+596
-239
lines changed

clients/client-ec2/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -4253,6 +4253,14 @@ ModifyInstanceCapacityReservationAttributes
42534253

42544254
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/ModifyInstanceCapacityReservationAttributesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/ModifyInstanceCapacityReservationAttributesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/ModifyInstanceCapacityReservationAttributesCommandOutput/)
42554255

4256+
</details>
4257+
<details>
4258+
<summary>
4259+
ModifyInstanceCpuOptions
4260+
</summary>
4261+
4262+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/ModifyInstanceCpuOptionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/ModifyInstanceCpuOptionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/ModifyInstanceCpuOptionsCommandOutput/)
4263+
42564264
</details>
42574265
<details>
42584266
<summary>

clients/client-ec2/src/EC2.ts

+23
Original file line numberDiff line numberDiff line change
@@ -2468,6 +2468,11 @@ import {
24682468
ModifyInstanceCapacityReservationAttributesCommandInput,
24692469
ModifyInstanceCapacityReservationAttributesCommandOutput,
24702470
} from "./commands/ModifyInstanceCapacityReservationAttributesCommand";
2471+
import {
2472+
ModifyInstanceCpuOptionsCommand,
2473+
ModifyInstanceCpuOptionsCommandInput,
2474+
ModifyInstanceCpuOptionsCommandOutput,
2475+
} from "./commands/ModifyInstanceCpuOptionsCommand";
24712476
import {
24722477
ModifyInstanceCreditSpecificationCommand,
24732478
ModifyInstanceCreditSpecificationCommandInput,
@@ -3578,6 +3583,7 @@ const commands = {
35783583
ModifyImageAttributeCommand,
35793584
ModifyInstanceAttributeCommand,
35803585
ModifyInstanceCapacityReservationAttributesCommand,
3586+
ModifyInstanceCpuOptionsCommand,
35813587
ModifyInstanceCreditSpecificationCommand,
35823588
ModifyInstanceEventStartTimeCommand,
35833589
ModifyInstanceEventWindowCommand,
@@ -12182,6 +12188,23 @@ export interface EC2 {
1218212188
cb: (err: any, data?: ModifyInstanceCapacityReservationAttributesCommandOutput) => void
1218312189
): void;
1218412190

12191+
/**
12192+
* @see {@link ModifyInstanceCpuOptionsCommand}
12193+
*/
12194+
modifyInstanceCpuOptions(
12195+
args: ModifyInstanceCpuOptionsCommandInput,
12196+
options?: __HttpHandlerOptions
12197+
): Promise<ModifyInstanceCpuOptionsCommandOutput>;
12198+
modifyInstanceCpuOptions(
12199+
args: ModifyInstanceCpuOptionsCommandInput,
12200+
cb: (err: any, data?: ModifyInstanceCpuOptionsCommandOutput) => void
12201+
): void;
12202+
modifyInstanceCpuOptions(
12203+
args: ModifyInstanceCpuOptionsCommandInput,
12204+
options: __HttpHandlerOptions,
12205+
cb: (err: any, data?: ModifyInstanceCpuOptionsCommandOutput) => void
12206+
): void;
12207+
1218512208
/**
1218612209
* @see {@link ModifyInstanceCreditSpecificationCommand}
1218712210
*/

clients/client-ec2/src/EC2Client.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1768,6 +1768,10 @@ import {
17681768
ModifyInstanceCapacityReservationAttributesCommandInput,
17691769
ModifyInstanceCapacityReservationAttributesCommandOutput,
17701770
} from "./commands/ModifyInstanceCapacityReservationAttributesCommand";
1771+
import {
1772+
ModifyInstanceCpuOptionsCommandInput,
1773+
ModifyInstanceCpuOptionsCommandOutput,
1774+
} from "./commands/ModifyInstanceCpuOptionsCommand";
17711775
import {
17721776
ModifyInstanceCreditSpecificationCommandInput,
17731777
ModifyInstanceCreditSpecificationCommandOutput,
@@ -2698,6 +2702,7 @@ export type ServiceInputTypes =
26982702
| ModifyImageAttributeCommandInput
26992703
| ModifyInstanceAttributeCommandInput
27002704
| ModifyInstanceCapacityReservationAttributesCommandInput
2705+
| ModifyInstanceCpuOptionsCommandInput
27012706
| ModifyInstanceCreditSpecificationCommandInput
27022707
| ModifyInstanceEventStartTimeCommandInput
27032708
| ModifyInstanceEventWindowCommandInput
@@ -3330,6 +3335,7 @@ export type ServiceOutputTypes =
33303335
| ModifyImageAttributeCommandOutput
33313336
| ModifyInstanceAttributeCommandOutput
33323337
| ModifyInstanceCapacityReservationAttributesCommandOutput
3338+
| ModifyInstanceCpuOptionsCommandOutput
33333339
| ModifyInstanceCreditSpecificationCommandOutput
33343340
| ModifyInstanceEventStartTimeCommandOutput
33353341
| ModifyInstanceEventWindowCommandOutput
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { ModifyInstanceCpuOptionsRequest, ModifyInstanceCpuOptionsResult } from "../models/models_6";
10+
import { de_ModifyInstanceCpuOptionsCommand, se_ModifyInstanceCpuOptionsCommand } from "../protocols/Aws_ec2";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link ModifyInstanceCpuOptionsCommand}.
21+
*/
22+
export interface ModifyInstanceCpuOptionsCommandInput extends ModifyInstanceCpuOptionsRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link ModifyInstanceCpuOptionsCommand}.
27+
*/
28+
export interface ModifyInstanceCpuOptionsCommandOutput extends ModifyInstanceCpuOptionsResult, __MetadataBearer {}
29+
30+
/**
31+
* <p>By default, all vCPUs for the instance type are active when you launch an instance. When you
32+
* configure the number of active vCPUs for the instance, it can help you save on licensing costs and
33+
* optimize performance. The base cost of the instance remains unchanged.</p>
34+
* <p>The number of active vCPUs equals the number of threads per CPU core multiplied by the number
35+
* of cores.</p>
36+
* <note>
37+
* <p>Some instance type options do not support this capability. For more information, see
38+
* <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cpu-options-supported-instances-values.html">Supported CPU
39+
* options</a> in the <i>Amazon EC2 User Guide</i>.</p>
40+
* </note>
41+
* @example
42+
* Use a bare-bones client and the command you need to make an API call.
43+
* ```javascript
44+
* import { EC2Client, ModifyInstanceCpuOptionsCommand } from "@aws-sdk/client-ec2"; // ES Modules import
45+
* // const { EC2Client, ModifyInstanceCpuOptionsCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
46+
* const client = new EC2Client(config);
47+
* const input = { // ModifyInstanceCpuOptionsRequest
48+
* InstanceId: "STRING_VALUE", // required
49+
* CoreCount: Number("int"), // required
50+
* ThreadsPerCore: Number("int"), // required
51+
* DryRun: true || false,
52+
* };
53+
* const command = new ModifyInstanceCpuOptionsCommand(input);
54+
* const response = await client.send(command);
55+
* // { // ModifyInstanceCpuOptionsResult
56+
* // InstanceId: "STRING_VALUE",
57+
* // CoreCount: Number("int"),
58+
* // ThreadsPerCore: Number("int"),
59+
* // };
60+
*
61+
* ```
62+
*
63+
* @param ModifyInstanceCpuOptionsCommandInput - {@link ModifyInstanceCpuOptionsCommandInput}
64+
* @returns {@link ModifyInstanceCpuOptionsCommandOutput}
65+
* @see {@link ModifyInstanceCpuOptionsCommandInput} for command's `input` shape.
66+
* @see {@link ModifyInstanceCpuOptionsCommandOutput} for command's `response` shape.
67+
* @see {@link EC2ClientResolvedConfig | config} for EC2Client's `config` shape.
68+
*
69+
* @throws {@link EC2ServiceException}
70+
* <p>Base exception class for all service exceptions from EC2 service.</p>
71+
*
72+
* @public
73+
*/
74+
export class ModifyInstanceCpuOptionsCommand extends $Command
75+
.classBuilder<
76+
ModifyInstanceCpuOptionsCommandInput,
77+
ModifyInstanceCpuOptionsCommandOutput,
78+
EC2ClientResolvedConfig,
79+
ServiceInputTypes,
80+
ServiceOutputTypes
81+
>()
82+
.ep(commonParams)
83+
.m(function (this: any, Command: any, cs: any, config: EC2ClientResolvedConfig, o: any) {
84+
return [
85+
getSerdePlugin(config, this.serialize, this.deserialize),
86+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
87+
];
88+
})
89+
.s("AmazonEC2", "ModifyInstanceCpuOptions", {})
90+
.n("EC2Client", "ModifyInstanceCpuOptionsCommand")
91+
.f(void 0, void 0)
92+
.ser(se_ModifyInstanceCpuOptionsCommand)
93+
.de(de_ModifyInstanceCpuOptionsCommand)
94+
.build() {
95+
/** @internal type navigation helper, not in runtime. */
96+
protected declare static __types: {
97+
api: {
98+
input: ModifyInstanceCpuOptionsRequest;
99+
output: ModifyInstanceCpuOptionsResult;
100+
};
101+
sdk: {
102+
input: ModifyInstanceCpuOptionsCommandInput;
103+
output: ModifyInstanceCpuOptionsCommandOutput;
104+
};
105+
};
106+
}

clients/client-ec2/src/commands/ModifyVpnConnectionCommand.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import {
10-
ModifyVpnConnectionRequest,
11-
ModifyVpnConnectionResult,
12-
ModifyVpnConnectionResultFilterSensitiveLog,
13-
} from "../models/models_6";
9+
import { ModifyVpnConnectionRequest } from "../models/models_6";
10+
import { ModifyVpnConnectionResult, ModifyVpnConnectionResultFilterSensitiveLog } from "../models/models_7";
1411
import { de_ModifyVpnConnectionCommand, se_ModifyVpnConnectionCommand } from "../protocols/Aws_ec2";
1512

1613
/**

clients/client-ec2/src/commands/ModifyVpnConnectionOptionsCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { ModifyVpnConnectionOptionsRequest } from "../models/models_6";
109
import {
10+
ModifyVpnConnectionOptionsRequest,
1111
ModifyVpnConnectionOptionsResult,
1212
ModifyVpnConnectionOptionsResultFilterSensitiveLog,
1313
} from "../models/models_7";

clients/client-ec2/src/commands/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ export * from "./ModifyIdentityIdFormatCommand";
505505
export * from "./ModifyImageAttributeCommand";
506506
export * from "./ModifyInstanceAttributeCommand";
507507
export * from "./ModifyInstanceCapacityReservationAttributesCommand";
508+
export * from "./ModifyInstanceCpuOptionsCommand";
508509
export * from "./ModifyInstanceCreditSpecificationCommand";
509510
export * from "./ModifyInstanceEventStartTimeCommand";
510511
export * from "./ModifyInstanceEventWindowCommand";

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

+7-8
Original file line numberDiff line numberDiff line change
@@ -862,11 +862,10 @@ export interface TransitGatewayVpcAttachmentOptions {
862862
DnsSupport?: DnsSupportValue;
863863

864864
/**
865-
* <p>Enables you to reference a security group across VPCs attached to a transit gateway to simplify security group management.
866-
*
867-
* </p>
868-
* <p>This option is disabled by default.</p>
869-
* <p>For more information about security group referencing, see <a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#vpc-attachment-security">Security group referencing</a> in the <i>Amazon Web Services Transit Gateways Guide</i>.</p>
865+
* <note>
866+
* <p>This parameter is in preview and may not be available for your account.</p>
867+
* </note>
868+
* <p>Enables you to reference a security group across VPCs attached to a transit gateway. Use this option to simplify security group management and control of instance-to-instance traffic across VPCs that are connected by transit gateway. You can also use this option to migrate from VPC peering (which was the only option that supported security group referencing) to transit gateways (which now also support security group referencing). This option is disabled by default and there are no additional costs to use this feature.</p>
870869
* @public
871870
*/
872871
SecurityGroupReferencingSupport?: SecurityGroupReferencingSupportValue;
@@ -7838,9 +7837,9 @@ export interface ConfirmProductInstanceRequest {
78387837
ProductCode: string | undefined;
78397838

78407839
/**
7841-
* <p>Checks whether you have the required permissions for the action, without actually making the request,
7842-
* and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>.
7843-
* Otherwise, it is <code>UnauthorizedOperation</code>.</p>
7840+
* <p>Checks whether you have the required permissions for the operation, without actually making the
7841+
* request, and provides an error response. If you have the required permissions, the error response is
7842+
* <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
78447843
* @public
78457844
*/
78467845
DryRun?: boolean;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -4241,7 +4241,7 @@ export interface CreateFleetInstance {
42414241
InstanceType?: _InstanceType;
42424242

42434243
/**
4244-
* <p>The value is <code>Windows</code> for Windows instances. Otherwise, the value is
4244+
* <p>The value is <code>windows</code> for Windows instances in an EC2 Fleet. Otherwise, the value is
42454245
* blank.</p>
42464246
* @public
42474247
*/

clients/client-ec2/src/models/models_2.ts

+17-18
Original file line numberDiff line numberDiff line change
@@ -901,9 +901,9 @@ export type PlacementStrategy = (typeof PlacementStrategy)[keyof typeof Placemen
901901
*/
902902
export interface CreatePlacementGroupRequest {
903903
/**
904-
* <p>Checks whether you have the required permissions for the action, without actually making the request,
905-
* and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>.
906-
* Otherwise, it is <code>UnauthorizedOperation</code>.</p>
904+
* <p>Checks whether you have the required permissions for the operation, without actually making the
905+
* request, and provides an error response. If you have the required permissions, the error response is
906+
* <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
907907
* @public
908908
*/
909909
DryRun?: boolean;
@@ -2294,8 +2294,8 @@ export interface CreateSnapshotsResult {
22942294
export interface CreateSpotDatafeedSubscriptionRequest {
22952295
/**
22962296
* <p>The name of the Amazon S3 bucket in which to store the Spot Instance data feed. For
2297-
* more information about bucket names, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html#bucketnamingrules">Rules for bucket
2298-
* naming</a> in the <i>Amazon S3 Developer Guide</i>.</p>
2297+
* more information about bucket names, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Bucket naming rules</a>
2298+
* in the <i>Amazon S3 User Guide</i>.</p>
22992299
* @public
23002300
*/
23012301
Bucket: string | undefined;
@@ -3489,11 +3489,10 @@ export interface TransitGatewayRequestOptions {
34893489
DnsSupport?: DnsSupportValue;
34903490

34913491
/**
3492-
* <p>Enables you to reference a security group across VPCs attached to a transit gateway to simplify security group management.
3493-
*
3494-
* </p>
3495-
* <p>This option is disabled by default.</p>
3496-
* <p>For more information about security group referencing, see <a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#vpc-attachment-security">Security group referencing</a> in the <i>Amazon Web Services Transit Gateways Guide</i>.</p>
3492+
* <note>
3493+
* <p>This parameter is in preview and may not be available for your account.</p>
3494+
* </note>
3495+
* <p>Enables you to reference a security group across VPCs attached to a transit gateway. Use this option to simplify security group management and control of instance-to-instance traffic across VPCs that are connected by transit gateway. You can also use this option to migrate from VPC peering (which was the only option that supported security group referencing) to transit gateways (which now also support security group referencing). This option is disabled by default and there are no additional costs to use this feature.</p>
34973496
* @public
34983497
*/
34993498
SecurityGroupReferencingSupport?: SecurityGroupReferencingSupportValue;
@@ -3603,9 +3602,10 @@ export interface TransitGatewayOptions {
36033602
DnsSupport?: DnsSupportValue;
36043603

36053604
/**
3606-
* <p>Enables you to reference a security group across VPCs attached to a transit gateway to simplify security group management.</p>
3607-
* <p>This option is enabled by default.</p>
3608-
* <p>For more information about security group referencing, see <a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#vpc-attachment-security">Security group referencing</a> in the <i>Amazon Web Services Transit Gateways Guide</i>.</p>
3605+
* <note>
3606+
* <p>This parameter is in preview and may not be available for your account.</p>
3607+
* </note>
3608+
* <p>Enables you to reference a security group across VPCs attached to a transit gateway. Use this option to simplify security group management and control of instance-to-instance traffic across VPCs that are connected by transit gateway. You can also use this option to migrate from VPC peering (which was the only option that supported security group referencing) to transit gateways (which now also support security group referencing). This option is disabled by default and there are no additional costs to use this feature.</p>
36093609
* @public
36103610
*/
36113611
SecurityGroupReferencingSupport?: SecurityGroupReferencingSupportValue;
@@ -4952,14 +4952,13 @@ export interface CreateTransitGatewayVpcAttachmentRequestOptions {
49524952
DnsSupport?: DnsSupportValue;
49534953

49544954
/**
4955-
* <p>Enables you to reference a security group across VPCs attached to a transit gateway to simplify security group management.
4956-
*
4957-
* </p>
4958-
* <p>This option is disabled by default.</p>
4955+
* <note>
4956+
* <p>This parameter is in preview and may not be available for your account.</p>
4957+
* </note>
4958+
* <p>Enables you to reference a security group across VPCs attached to a transit gateway. Use this option to simplify security group management and control of instance-to-instance traffic across VPCs that are connected by transit gateway. You can also use this option to migrate from VPC peering (which was the only option that supported security group referencing) to transit gateways (which now also support security group referencing). This option is disabled by default and there are no additional costs to use this feature.</p>
49594959
* <p>If you don't enable or disable SecurityGroupReferencingSupport in the request, the
49604960
* attachment will inherit the security group referencing support setting on the transit
49614961
* gateway.</p>
4962-
* <p>For more information about security group referencing, see <a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#vpc-attachment-security">Security group referencing </a> in the <i>Amazon Web Services Transit Gateways Guide</i>.</p>
49634962
* @public
49644963
*/
49654964
SecurityGroupReferencingSupport?: SecurityGroupReferencingSupportValue;

clients/client-ec2/src/models/models_3.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,9 @@ export interface DeleteNetworkInterfacePermissionResult {
544544
*/
545545
export interface DeletePlacementGroupRequest {
546546
/**
547-
* <p>Checks whether you have the required permissions for the action, without actually making the request,
548-
* and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>.
549-
* Otherwise, it is <code>UnauthorizedOperation</code>.</p>
547+
* <p>Checks whether you have the required permissions for the operation, without actually making the
548+
* request, and provides an error response. If you have the required permissions, the error response is
549+
* <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
550550
* @public
551551
*/
552552
DryRun?: boolean;
@@ -6480,7 +6480,7 @@ export interface DescribeFleetsInstances {
64806480
InstanceType?: _InstanceType;
64816481

64826482
/**
6483-
* <p>The value is <code>Windows</code> for Windows instances. Otherwise, the value is
6483+
* <p>The value is <code>windows</code> for Windows instances in an EC2 Fleet. Otherwise, the value is
64846484
* blank.</p>
64856485
* @public
64866486
*/

0 commit comments

Comments
 (0)