Skip to content

Commit

Permalink
feat(client-ec2): This release simplifies the auto-recovery configura…
Browse files Browse the repository at this point in the history
…tion process enabling customers to set the recovery behavior to disabled or default
  • Loading branch information
awstools committed Mar 30, 2022
1 parent 3c918da commit 4e3290e
Show file tree
Hide file tree
Showing 39 changed files with 81,294 additions and 80,485 deletions.
186 changes: 121 additions & 65 deletions clients/client-ec2/src/EC2.ts

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions clients/client-ec2/src/EC2Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,10 @@ import {
ModifyInstanceEventWindowCommandInput,
ModifyInstanceEventWindowCommandOutput,
} from "./commands/ModifyInstanceEventWindowCommand";
import {
ModifyInstanceMaintenanceOptionsCommandInput,
ModifyInstanceMaintenanceOptionsCommandOutput,
} from "./commands/ModifyInstanceMaintenanceOptionsCommand";
import {
ModifyInstanceMetadataOptionsCommandInput,
ModifyInstanceMetadataOptionsCommandOutput,
Expand Down Expand Up @@ -2207,6 +2211,7 @@ export type ServiceInputTypes =
| ModifyInstanceCreditSpecificationCommandInput
| ModifyInstanceEventStartTimeCommandInput
| ModifyInstanceEventWindowCommandInput
| ModifyInstanceMaintenanceOptionsCommandInput
| ModifyInstanceMetadataOptionsCommandInput
| ModifyInstancePlacementCommandInput
| ModifyIpamCommandInput
Expand Down Expand Up @@ -2730,6 +2735,7 @@ export type ServiceOutputTypes =
| ModifyInstanceCreditSpecificationCommandOutput
| ModifyInstanceEventStartTimeCommandOutput
| ModifyInstanceEventWindowCommandOutput
| ModifyInstanceMaintenanceOptionsCommandOutput
| ModifyInstanceMetadataOptionsCommandOutput
| ModifyInstancePlacementCommandOutput
| ModifyIpamCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export interface CreateLaunchTemplateVersionCommandOutput extends CreateLaunchTe
* launch template from which to base the new version.</p>
* <p>Launch template versions are numbered in the order in which they are created. You
* cannot specify, change, or replace the numbering of launch template versions.</p>
* <p>For
* more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#manage-launch-template-versions">Managing launch template versions</a>in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#manage-launch-template-versions">Managing launch template versions</a>in the
* <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
} from "@aws-sdk/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { CreateTransitGatewayConnectRequest, CreateTransitGatewayConnectResult } from "../models/models_1";
import { CreateTransitGatewayConnectRequest } from "../models/models_1";
import { CreateTransitGatewayConnectResult } from "../models/models_2";
import {
deserializeAws_ec2CreateTransitGatewayConnectCommand,
serializeAws_ec2CreateTransitGatewayConnectCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export interface DeleteLaunchTemplateCommandInput extends DeleteLaunchTemplateRe
export interface DeleteLaunchTemplateCommandOutput extends DeleteLaunchTemplateResult, __MetadataBearer {}

/**
* <p>Deletes a launch template. Deleting a launch template deletes all of its versions.</p>
* <p>Deletes a launch template. Deleting a launch template deletes all of its
* versions.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
3 changes: 2 additions & 1 deletion clients/client-ec2/src/commands/DescribeCoipPoolsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
} from "@aws-sdk/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { DescribeCoipPoolsRequest, DescribeCoipPoolsResult } from "../models/models_2";
import { DescribeCoipPoolsRequest } from "../models/models_2";
import { DescribeCoipPoolsResult } from "../models/models_3";
import {
deserializeAws_ec2DescribeCoipPoolsCommand,
serializeAws_ec2DescribeCoipPoolsCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import {
} from "@aws-sdk/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { DescribeConversionTasksRequest } from "../models/models_2";
import { DescribeConversionTasksResult } from "../models/models_3";
import { DescribeConversionTasksRequest, DescribeConversionTasksResult } from "../models/models_3";
import {
deserializeAws_ec2DescribeConversionTasksCommand,
serializeAws_ec2DescribeConversionTasksCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export interface DescribeInstanceStatusCommandOutput extends DescribeInstanceSta
* <b>Scheduled events</b> - Amazon EC2 can schedule
* events (such as reboot, stop, or terminate) for your instances related to
* hardware issues, software updates, or system maintenance. For more information,
* see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html">Scheduled events for your instances</a> in the <i>Amazon EC2 User Guide</i>.</p>
* see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html">Scheduled events for your instances</a> in the <i>Amazon EC2 User
* Guide</i>.</p>
* </li>
* <li>
* <p>
Expand Down
15 changes: 8 additions & 7 deletions clients/client-ec2/src/commands/DescribeInstancesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ export interface DescribeInstancesCommandOutput extends DescribeInstancesResult,

/**
* <p>Describes the specified instances or all instances.</p>
* <p>If you specify instance IDs, the output includes information for only the specified instances.
* If you specify filters, the output includes information for only those instances that meet the filter criteria.
* If you do not specify instance IDs or filters, the output includes information for all instances,
* which can affect performance. We recommend that you use pagination to ensure that the operation
* returns quickly and successfully.</p>
* <p>If you specify an instance ID that is not valid, an error is returned. If you
* specify an instance that you do not own, it is not included in the output.</p>
* <p>If you specify instance IDs, the output includes information for only the specified
* instances. If you specify filters, the output includes information for only those
* instances that meet the filter criteria. If you do not specify instance IDs or filters,
* the output includes information for all instances, which can affect performance. We
* recommend that you use pagination to ensure that the operation returns quickly and
* successfully.</p>
* <p>If you specify an instance ID that is not valid, an error is returned. If you specify
* an instance that you do not own, it is not included in the output.</p>
* <p>Recently terminated instances might appear in the returned results. This interval is
* usually less than one hour.</p>
* <p>If you describe instances in the rare case where an Availability Zone is experiencing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from "@aws-sdk/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { DescribeReplaceRootVolumeTasksRequest, DescribeReplaceRootVolumeTasksResult } from "../models/models_3";
import { DescribeReplaceRootVolumeTasksRequest, DescribeReplaceRootVolumeTasksResult } from "../models/models_4";
import {
deserializeAws_ec2DescribeReplaceRootVolumeTasksCommand,
serializeAws_ec2DescribeReplaceRootVolumeTasksCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import {
} from "@aws-sdk/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { DescribeReservedInstancesRequest } from "../models/models_3";
import { DescribeReservedInstancesResult } from "../models/models_4";
import { DescribeReservedInstancesRequest, DescribeReservedInstancesResult } from "../models/models_4";
import {
deserializeAws_ec2DescribeReservedInstancesCommand,
serializeAws_ec2DescribeReservedInstancesCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ export interface GetDefaultCreditSpecificationCommandOutput
__MetadataBearer {}

/**
* <p>Describes the default credit option for CPU usage of a burstable performance instance family.</p>
* <p>Describes the default credit option for CPU usage of a burstable performance instance
* family.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html">Burstable
* performance instances</a> in the <i>Amazon EC2 User Guide</i>.</p>
* performance instances</a> in the <i>Amazon EC2 User Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from "@aws-sdk/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { GetGroupsForCapacityReservationRequest, GetGroupsForCapacityReservationResult } from "../models/models_4";
import { GetGroupsForCapacityReservationRequest, GetGroupsForCapacityReservationResult } from "../models/models_5";
import {
deserializeAws_ec2GetGroupsForCapacityReservationCommand,
serializeAws_ec2GetGroupsForCapacityReservationCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import {
} from "@aws-sdk/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { GetHostReservationPurchasePreviewRequest } from "../models/models_4";
import { GetHostReservationPurchasePreviewResult } from "../models/models_5";
import { GetHostReservationPurchasePreviewRequest, GetHostReservationPurchasePreviewResult } from "../models/models_5";
import {
deserializeAws_ec2GetHostReservationPurchasePreviewCommand,
serializeAws_ec2GetHostReservationPurchasePreviewCommand,
Expand Down
12 changes: 7 additions & 5 deletions clients/client-ec2/src/commands/GetLaunchTemplateDataCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ export interface GetLaunchTemplateDataCommandInput extends GetLaunchTemplateData
export interface GetLaunchTemplateDataCommandOutput extends GetLaunchTemplateDataResult, __MetadataBearer {}

/**
* <p>Retrieves the configuration data of the specified instance. You can use this data
* to create a launch template. </p>
* <p>This action calls on other describe actions to get instance information. Depending on your instance configuration, you may need to allow the following
* actions in your IAM policy: DescribeSpotInstanceRequests, DescribeInstanceCreditSpecifications, DescribeVolumes, DescribeInstanceAttribute, and DescribeElasticGpus. Or, you can allow
* <code>describe*</code> depending on your instance requirements.</p>
* <p>Retrieves the configuration data of the specified instance. You can use this data to
* create a launch template. </p>
* <p>This action calls on other describe actions to get instance information. Depending on
* your instance configuration, you may need to allow the following actions in your IAM
* policy: DescribeSpotInstanceRequests, DescribeInstanceCreditSpecifications,
* DescribeVolumes, DescribeInstanceAttribute, and DescribeElasticGpus. Or, you can allow
* <code>describe*</code> depending on your instance requirements.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
2 changes: 1 addition & 1 deletion clients/client-ec2/src/commands/GetPasswordDataCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface GetPasswordDataCommandOutput extends GetPasswordDataResult, __M
* <p>The Windows password is generated at boot by the <code>EC2Config</code> service or
* <code>EC2Launch</code> scripts (Windows Server 2016 and later). This usually only
* happens the first time an instance is launched. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/UsingConfig_WinAMI.html">EC2Config</a> and <a href="https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2launch.html">EC2Launch</a> in the
* <i>Amazon EC2 User Guide</i>.</p>
* <i>Amazon EC2 User Guide</i>.</p>
* <p>For the <code>EC2Config</code> service, the password is not generated for rebundled
* AMIs unless <code>Ec2SetPassword</code> is enabled before bundling.</p>
* <p>The password is encrypted using the key pair that you specified when you launched the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,19 @@ export interface ModifyDefaultCreditSpecificationCommandOutput

/**
* <p>Modifies the default credit option for CPU usage of burstable performance instances.
* The default credit option is set at the account level per Amazon Web Services Region, and is specified
* per instance family. All new burstable performance instances in the account launch using
* the default credit option.</p>
* The default credit option is set at the account level per Amazon Web Services Region, and
* is specified per instance family. All new burstable performance instances in the account
* launch using the default credit option.</p>
* <p>
* <code>ModifyDefaultCreditSpecification</code> is an asynchronous operation, which works at an Amazon Web Services Region
* level and modifies the credit option for each Availability Zone. All zones in a
* Region are updated within five minutes. But if instances are launched during this
* operation, they might not get the new credit option until the zone is updated. To verify
* whether the update has occurred, you can call <code>GetDefaultCreditSpecification</code> and check
* <code>DefaultCreditSpecification</code> for updates.</p>
* <code>ModifyDefaultCreditSpecification</code> is an asynchronous operation, which
* works at an Amazon Web Services Region level and modifies the credit option for each
* Availability Zone. All zones in a Region are updated within five minutes. But if
* instances are launched during this operation, they might not get the new credit option
* until the zone is updated. To verify whether the update has occurred, you can call
* <code>GetDefaultCreditSpecification</code> and check
* <code>DefaultCreditSpecification</code> for updates.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html">Burstable
* performance instances</a> in the <i>Amazon EC2 User Guide</i>.</p>
* performance instances</a> in the <i>Amazon EC2 User Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export interface ModifyInstanceAttributeCommandOutput extends __MetadataBearer {
* associated with an ENI attached to an instance that has multiple ENIs, we recommend that
* you use the <a>ModifyNetworkInterfaceAttribute</a> action.</p>
* <p>To modify some attributes, the instance must be stopped. For more information, see
* <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_ChangingAttributesWhileInstanceStopped.html">Modify a stopped instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
* <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_ChangingAttributesWhileInstanceStopped.html">Modify a stopped instance</a> in the
* <i>Amazon EC2 User Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { ModifyInstanceMaintenanceOptionsRequest, ModifyInstanceMaintenanceOptionsResult } from "../models/models_5";
import {
deserializeAws_ec2ModifyInstanceMaintenanceOptionsCommand,
serializeAws_ec2ModifyInstanceMaintenanceOptionsCommand,
} from "../protocols/Aws_ec2";

export interface ModifyInstanceMaintenanceOptionsCommandInput extends ModifyInstanceMaintenanceOptionsRequest {}
export interface ModifyInstanceMaintenanceOptionsCommandOutput
extends ModifyInstanceMaintenanceOptionsResult,
__MetadataBearer {}

/**
* <p>Modifies the recovery behavior of your instance to disable simplified automatic
* recovery or set the recovery behavior to default. The default configuration will not
* enable simplified automatic recovery for an unsupported instance type. For more
* information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-recover.html#instance-configuration-recovery">Simplified automatic recovery</a>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { EC2Client, ModifyInstanceMaintenanceOptionsCommand } from "@aws-sdk/client-ec2"; // ES Modules import
* // const { EC2Client, ModifyInstanceMaintenanceOptionsCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
* const client = new EC2Client(config);
* const command = new ModifyInstanceMaintenanceOptionsCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link ModifyInstanceMaintenanceOptionsCommandInput} for command's `input` shape.
* @see {@link ModifyInstanceMaintenanceOptionsCommandOutput} for command's `response` shape.
* @see {@link EC2ClientResolvedConfig | config} for EC2Client's `config` shape.
*
*/
export class ModifyInstanceMaintenanceOptionsCommand extends $Command<
ModifyInstanceMaintenanceOptionsCommandInput,
ModifyInstanceMaintenanceOptionsCommandOutput,
EC2ClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

constructor(readonly input: ModifyInstanceMaintenanceOptionsCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: EC2ClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ModifyInstanceMaintenanceOptionsCommandInput, ModifyInstanceMaintenanceOptionsCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "EC2Client";
const commandName = "ModifyInstanceMaintenanceOptionsCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: ModifyInstanceMaintenanceOptionsRequest.filterSensitiveLog,
outputFilterSensitiveLog: ModifyInstanceMaintenanceOptionsResult.filterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(
input: ModifyInstanceMaintenanceOptionsCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> {
return serializeAws_ec2ModifyInstanceMaintenanceOptionsCommand(input, context);
}

private deserialize(
output: __HttpResponse,
context: __SerdeContext
): Promise<ModifyInstanceMaintenanceOptionsCommandOutput> {
return deserializeAws_ec2ModifyInstanceMaintenanceOptionsCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
Loading

0 comments on commit 4e3290e

Please sign in to comment.