Skip to content

Commit

Permalink
feat(client-ec2): This release includes a new API for modifying insta…
Browse files Browse the repository at this point in the history
…nce cpu-options after launch.
  • Loading branch information
awstools committed Oct 3, 2024
1 parent a7f70be commit a29a5e4
Show file tree
Hide file tree
Showing 17 changed files with 596 additions and 239 deletions.
8 changes: 8 additions & 0 deletions clients/client-ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4253,6 +4253,14 @@ ModifyInstanceCapacityReservationAttributes

[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/)

</details>
<details>
<summary>
ModifyInstanceCpuOptions
</summary>

[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/)

</details>
<details>
<summary>
Expand Down
23 changes: 23 additions & 0 deletions clients/client-ec2/src/EC2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2468,6 +2468,11 @@ import {
ModifyInstanceCapacityReservationAttributesCommandInput,
ModifyInstanceCapacityReservationAttributesCommandOutput,
} from "./commands/ModifyInstanceCapacityReservationAttributesCommand";
import {
ModifyInstanceCpuOptionsCommand,
ModifyInstanceCpuOptionsCommandInput,
ModifyInstanceCpuOptionsCommandOutput,
} from "./commands/ModifyInstanceCpuOptionsCommand";
import {
ModifyInstanceCreditSpecificationCommand,
ModifyInstanceCreditSpecificationCommandInput,
Expand Down Expand Up @@ -3578,6 +3583,7 @@ const commands = {
ModifyImageAttributeCommand,
ModifyInstanceAttributeCommand,
ModifyInstanceCapacityReservationAttributesCommand,
ModifyInstanceCpuOptionsCommand,
ModifyInstanceCreditSpecificationCommand,
ModifyInstanceEventStartTimeCommand,
ModifyInstanceEventWindowCommand,
Expand Down Expand Up @@ -12182,6 +12188,23 @@ export interface EC2 {
cb: (err: any, data?: ModifyInstanceCapacityReservationAttributesCommandOutput) => void
): void;

/**
* @see {@link ModifyInstanceCpuOptionsCommand}
*/
modifyInstanceCpuOptions(
args: ModifyInstanceCpuOptionsCommandInput,
options?: __HttpHandlerOptions
): Promise<ModifyInstanceCpuOptionsCommandOutput>;
modifyInstanceCpuOptions(
args: ModifyInstanceCpuOptionsCommandInput,
cb: (err: any, data?: ModifyInstanceCpuOptionsCommandOutput) => void
): void;
modifyInstanceCpuOptions(
args: ModifyInstanceCpuOptionsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ModifyInstanceCpuOptionsCommandOutput) => void
): void;

/**
* @see {@link ModifyInstanceCreditSpecificationCommand}
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-ec2/src/EC2Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1768,6 +1768,10 @@ import {
ModifyInstanceCapacityReservationAttributesCommandInput,
ModifyInstanceCapacityReservationAttributesCommandOutput,
} from "./commands/ModifyInstanceCapacityReservationAttributesCommand";
import {
ModifyInstanceCpuOptionsCommandInput,
ModifyInstanceCpuOptionsCommandOutput,
} from "./commands/ModifyInstanceCpuOptionsCommand";
import {
ModifyInstanceCreditSpecificationCommandInput,
ModifyInstanceCreditSpecificationCommandOutput,
Expand Down Expand Up @@ -2698,6 +2702,7 @@ export type ServiceInputTypes =
| ModifyImageAttributeCommandInput
| ModifyInstanceAttributeCommandInput
| ModifyInstanceCapacityReservationAttributesCommandInput
| ModifyInstanceCpuOptionsCommandInput
| ModifyInstanceCreditSpecificationCommandInput
| ModifyInstanceEventStartTimeCommandInput
| ModifyInstanceEventWindowCommandInput
Expand Down Expand Up @@ -3330,6 +3335,7 @@ export type ServiceOutputTypes =
| ModifyImageAttributeCommandOutput
| ModifyInstanceAttributeCommandOutput
| ModifyInstanceCapacityReservationAttributesCommandOutput
| ModifyInstanceCpuOptionsCommandOutput
| ModifyInstanceCreditSpecificationCommandOutput
| ModifyInstanceEventStartTimeCommandOutput
| ModifyInstanceEventWindowCommandOutput
Expand Down
106 changes: 106 additions & 0 deletions clients/client-ec2/src/commands/ModifyInstanceCpuOptionsCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { commonParams } from "../endpoint/EndpointParameters";
import { ModifyInstanceCpuOptionsRequest, ModifyInstanceCpuOptionsResult } from "../models/models_6";
import { de_ModifyInstanceCpuOptionsCommand, se_ModifyInstanceCpuOptionsCommand } from "../protocols/Aws_ec2";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link ModifyInstanceCpuOptionsCommand}.
*/
export interface ModifyInstanceCpuOptionsCommandInput extends ModifyInstanceCpuOptionsRequest {}
/**
* @public
*
* The output of {@link ModifyInstanceCpuOptionsCommand}.
*/
export interface ModifyInstanceCpuOptionsCommandOutput extends ModifyInstanceCpuOptionsResult, __MetadataBearer {}

/**
* <p>By default, all vCPUs for the instance type are active when you launch an instance. When you
* configure the number of active vCPUs for the instance, it can help you save on licensing costs and
* optimize performance. The base cost of the instance remains unchanged.</p>
* <p>The number of active vCPUs equals the number of threads per CPU core multiplied by the number
* of cores.</p>
* <note>
* <p>Some instance type options do not support this capability. For more information, see
* <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cpu-options-supported-instances-values.html">Supported CPU
* options</a> in the <i>Amazon EC2 User Guide</i>.</p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { EC2Client, ModifyInstanceCpuOptionsCommand } from "@aws-sdk/client-ec2"; // ES Modules import
* // const { EC2Client, ModifyInstanceCpuOptionsCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
* const client = new EC2Client(config);
* const input = { // ModifyInstanceCpuOptionsRequest
* InstanceId: "STRING_VALUE", // required
* CoreCount: Number("int"), // required
* ThreadsPerCore: Number("int"), // required
* DryRun: true || false,
* };
* const command = new ModifyInstanceCpuOptionsCommand(input);
* const response = await client.send(command);
* // { // ModifyInstanceCpuOptionsResult
* // InstanceId: "STRING_VALUE",
* // CoreCount: Number("int"),
* // ThreadsPerCore: Number("int"),
* // };
*
* ```
*
* @param ModifyInstanceCpuOptionsCommandInput - {@link ModifyInstanceCpuOptionsCommandInput}
* @returns {@link ModifyInstanceCpuOptionsCommandOutput}
* @see {@link ModifyInstanceCpuOptionsCommandInput} for command's `input` shape.
* @see {@link ModifyInstanceCpuOptionsCommandOutput} for command's `response` shape.
* @see {@link EC2ClientResolvedConfig | config} for EC2Client's `config` shape.
*
* @throws {@link EC2ServiceException}
* <p>Base exception class for all service exceptions from EC2 service.</p>
*
* @public
*/
export class ModifyInstanceCpuOptionsCommand extends $Command
.classBuilder<
ModifyInstanceCpuOptionsCommandInput,
ModifyInstanceCpuOptionsCommandOutput,
EC2ClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: EC2ClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("AmazonEC2", "ModifyInstanceCpuOptions", {})
.n("EC2Client", "ModifyInstanceCpuOptionsCommand")
.f(void 0, void 0)
.ser(se_ModifyInstanceCpuOptionsCommand)
.de(de_ModifyInstanceCpuOptionsCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: ModifyInstanceCpuOptionsRequest;
output: ModifyInstanceCpuOptionsResult;
};
sdk: {
input: ModifyInstanceCpuOptionsCommandInput;
output: ModifyInstanceCpuOptionsCommandOutput;
};
};
}
7 changes: 2 additions & 5 deletions clients/client-ec2/src/commands/ModifyVpnConnectionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { commonParams } from "../endpoint/EndpointParameters";
import {
ModifyVpnConnectionRequest,
ModifyVpnConnectionResult,
ModifyVpnConnectionResultFilterSensitiveLog,
} from "../models/models_6";
import { ModifyVpnConnectionRequest } from "../models/models_6";
import { ModifyVpnConnectionResult, ModifyVpnConnectionResultFilterSensitiveLog } from "../models/models_7";
import { de_ModifyVpnConnectionCommand, se_ModifyVpnConnectionCommand } from "../protocols/Aws_ec2";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { commonParams } from "../endpoint/EndpointParameters";
import { ModifyVpnConnectionOptionsRequest } from "../models/models_6";
import {
ModifyVpnConnectionOptionsRequest,
ModifyVpnConnectionOptionsResult,
ModifyVpnConnectionOptionsResultFilterSensitiveLog,
} from "../models/models_7";
Expand Down
1 change: 1 addition & 0 deletions clients/client-ec2/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ export * from "./ModifyIdentityIdFormatCommand";
export * from "./ModifyImageAttributeCommand";
export * from "./ModifyInstanceAttributeCommand";
export * from "./ModifyInstanceCapacityReservationAttributesCommand";
export * from "./ModifyInstanceCpuOptionsCommand";
export * from "./ModifyInstanceCreditSpecificationCommand";
export * from "./ModifyInstanceEventStartTimeCommand";
export * from "./ModifyInstanceEventWindowCommand";
Expand Down
15 changes: 7 additions & 8 deletions clients/client-ec2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -862,11 +862,10 @@ export interface TransitGatewayVpcAttachmentOptions {
DnsSupport?: DnsSupportValue;

/**
* <p>Enables you to reference a security group across VPCs attached to a transit gateway to simplify security group management.
*
* </p>
* <p>This option is disabled by default.</p>
* <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>
* <note>
* <p>This parameter is in preview and may not be available for your account.</p>
* </note>
* <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>
* @public
*/
SecurityGroupReferencingSupport?: SecurityGroupReferencingSupportValue;
Expand Down Expand Up @@ -7838,9 +7837,9 @@ export interface ConfirmProductInstanceRequest {
ProductCode: string | undefined;

/**
* <p>Checks whether you have the required permissions for the action, without actually making the request,
* and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>.
* Otherwise, it is <code>UnauthorizedOperation</code>.</p>
* <p>Checks whether you have the required permissions for the operation, without actually making the
* request, and provides an error response. If you have the required permissions, the error response is
* <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
* @public
*/
DryRun?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion clients/client-ec2/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4241,7 +4241,7 @@ export interface CreateFleetInstance {
InstanceType?: _InstanceType;

/**
* <p>The value is <code>Windows</code> for Windows instances. Otherwise, the value is
* <p>The value is <code>windows</code> for Windows instances in an EC2 Fleet. Otherwise, the value is
* blank.</p>
* @public
*/
Expand Down
35 changes: 17 additions & 18 deletions clients/client-ec2/src/models/models_2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -901,9 +901,9 @@ export type PlacementStrategy = (typeof PlacementStrategy)[keyof typeof Placemen
*/
export interface CreatePlacementGroupRequest {
/**
* <p>Checks whether you have the required permissions for the action, without actually making the request,
* and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>.
* Otherwise, it is <code>UnauthorizedOperation</code>.</p>
* <p>Checks whether you have the required permissions for the operation, without actually making the
* request, and provides an error response. If you have the required permissions, the error response is
* <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
* @public
*/
DryRun?: boolean;
Expand Down Expand Up @@ -2294,8 +2294,8 @@ export interface CreateSnapshotsResult {
export interface CreateSpotDatafeedSubscriptionRequest {
/**
* <p>The name of the Amazon S3 bucket in which to store the Spot Instance data feed. For
* more information about bucket names, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html#bucketnamingrules">Rules for bucket
* naming</a> in the <i>Amazon S3 Developer Guide</i>.</p>
* more information about bucket names, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Bucket naming rules</a>
* in the <i>Amazon S3 User Guide</i>.</p>
* @public
*/
Bucket: string | undefined;
Expand Down Expand Up @@ -3489,11 +3489,10 @@ export interface TransitGatewayRequestOptions {
DnsSupport?: DnsSupportValue;

/**
* <p>Enables you to reference a security group across VPCs attached to a transit gateway to simplify security group management.
*
* </p>
* <p>This option is disabled by default.</p>
* <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>
* <note>
* <p>This parameter is in preview and may not be available for your account.</p>
* </note>
* <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>
* @public
*/
SecurityGroupReferencingSupport?: SecurityGroupReferencingSupportValue;
Expand Down Expand Up @@ -3603,9 +3602,10 @@ export interface TransitGatewayOptions {
DnsSupport?: DnsSupportValue;

/**
* <p>Enables you to reference a security group across VPCs attached to a transit gateway to simplify security group management.</p>
* <p>This option is enabled by default.</p>
* <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>
* <note>
* <p>This parameter is in preview and may not be available for your account.</p>
* </note>
* <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>
* @public
*/
SecurityGroupReferencingSupport?: SecurityGroupReferencingSupportValue;
Expand Down Expand Up @@ -4952,14 +4952,13 @@ export interface CreateTransitGatewayVpcAttachmentRequestOptions {
DnsSupport?: DnsSupportValue;

/**
* <p>Enables you to reference a security group across VPCs attached to a transit gateway to simplify security group management.
*
* </p>
* <p>This option is disabled by default.</p>
* <note>
* <p>This parameter is in preview and may not be available for your account.</p>
* </note>
* <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>
* <p>If you don't enable or disable SecurityGroupReferencingSupport in the request, the
* attachment will inherit the security group referencing support setting on the transit
* gateway.</p>
* <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>
* @public
*/
SecurityGroupReferencingSupport?: SecurityGroupReferencingSupportValue;
Expand Down
8 changes: 4 additions & 4 deletions clients/client-ec2/src/models/models_3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,9 @@ export interface DeleteNetworkInterfacePermissionResult {
*/
export interface DeletePlacementGroupRequest {
/**
* <p>Checks whether you have the required permissions for the action, without actually making the request,
* and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>.
* Otherwise, it is <code>UnauthorizedOperation</code>.</p>
* <p>Checks whether you have the required permissions for the operation, without actually making the
* request, and provides an error response. If you have the required permissions, the error response is
* <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
* @public
*/
DryRun?: boolean;
Expand Down Expand Up @@ -6480,7 +6480,7 @@ export interface DescribeFleetsInstances {
InstanceType?: _InstanceType;

/**
* <p>The value is <code>Windows</code> for Windows instances. Otherwise, the value is
* <p>The value is <code>windows</code> for Windows instances in an EC2 Fleet. Otherwise, the value is
* blank.</p>
* @public
*/
Expand Down
Loading

0 comments on commit a29a5e4

Please sign in to comment.