Skip to content

Commit

Permalink
feat(client-ec2): Adds support for allocating Dedicated Hosts on AWS …
Browse files Browse the repository at this point in the history
…Outposts. The AllocateHosts API now accepts an OutpostArn request parameter, and the DescribeHosts API now includes an OutpostArn response parameter.
  • Loading branch information
awstools committed May 3, 2022
1 parent 0d4912d commit 75a68fd
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 3 deletions.
3 changes: 2 additions & 1 deletion clients/client-ec2/src/EC2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21291,7 +21291,8 @@ export class EC2 extends EC2Client {
}

/**
* <p>Stops an Amazon EBS-backed instance.</p>
* <p>Stops an Amazon EBS-backed instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html">Stop and start
* your instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
* <p>You can use the Stop action to hibernate an instance if the instance is <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#enabling-hibernation">enabled for
* hibernation</a> and it meets the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites">hibernation
* prerequisites</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your instance</a> in the
Expand Down
3 changes: 2 additions & 1 deletion clients/client-ec2/src/commands/StopInstancesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export interface StopInstancesCommandInput extends StopInstancesRequest {}
export interface StopInstancesCommandOutput extends StopInstancesResult, __MetadataBearer {}

/**
* <p>Stops an Amazon EBS-backed instance.</p>
* <p>Stops an Amazon EBS-backed instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html">Stop and start
* your instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
* <p>You can use the Stop action to hibernate an instance if the instance is <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#enabling-hibernation">enabled for
* hibernation</a> and it meets the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites">hibernation
* prerequisites</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your instance</a> in the
Expand Down
5 changes: 5 additions & 0 deletions clients/client-ec2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2407,6 +2407,11 @@ export interface AllocateHostsRequest {
* </p>
*/
HostRecovery?: HostRecovery | string;

/**
* <p>The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which to allocate the Dedicated Host.</p>
*/
OutpostArn?: string;
}

export namespace AllocateHostsRequest {
Expand Down
5 changes: 5 additions & 0 deletions clients/client-ec2/src/models/models_3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3695,6 +3695,11 @@ export interface Host {
* <code>true</code>, the host is in a host resource group; otherwise, it is not.</p>
*/
MemberOfServiceLinkedResourceGroup?: boolean;

/**
* <p>The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which the Dedicated Host is allocated.</p>
*/
OutpostArn?: string;
}

export namespace Host {
Expand Down
7 changes: 7 additions & 0 deletions clients/client-ec2/src/protocols/Aws_ec2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32859,6 +32859,9 @@ const serializeAws_ec2AllocateHostsRequest = (input: AllocateHostsRequest, conte
if (input.HostRecovery !== undefined && input.HostRecovery !== null) {
entries["HostRecovery"] = input.HostRecovery;
}
if (input.OutpostArn !== undefined && input.OutpostArn !== null) {
entries["OutpostArn"] = input.OutpostArn;
}
return entries;
};

Expand Down Expand Up @@ -65522,6 +65525,7 @@ const deserializeAws_ec2Host = (output: any, context: __SerdeContext): Host => {
OwnerId: undefined,
AvailabilityZoneId: undefined,
MemberOfServiceLinkedResourceGroup: undefined,
OutpostArn: undefined,
};
if (output["autoPlacement"] !== undefined) {
contents.AutoPlacement = __expectString(output["autoPlacement"]);
Expand Down Expand Up @@ -65583,6 +65587,9 @@ const deserializeAws_ec2Host = (output: any, context: __SerdeContext): Host => {
if (output["memberOfServiceLinkedResourceGroup"] !== undefined) {
contents.MemberOfServiceLinkedResourceGroup = __parseBoolean(output["memberOfServiceLinkedResourceGroup"]);
}
if (output["outpostArn"] !== undefined) {
contents.OutpostArn = __expectString(output["outpostArn"]);
}
return contents;
};

Expand Down
16 changes: 15 additions & 1 deletion codegen/sdk-codegen/aws-models/ec2.json
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,12 @@
"traits": {
"smithy.api#documentation": "<p>Indicates whether to enable or disable host recovery for the Dedicated Host. \n\t\t\tHost recovery is disabled by default. For more information, see \n\t\t\t<a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html\">\n\t\t\tHost recovery</a> in the <i>Amazon EC2 User Guide</i>.</p>\n\t\t <p>Default: <code>off</code>\n </p>"
}
},
"OutpostArn": {
"target": "com.amazonaws.ec2#String",
"traits": {
"smithy.api#documentation": "<p>The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which to allocate the Dedicated Host.</p>"
}
}
}
},
Expand Down Expand Up @@ -39951,6 +39957,14 @@
"smithy.api#documentation": "<p>Indicates whether the Dedicated Host is in a host resource group. If \n\t\t\t<b>memberOfServiceLinkedResourceGroup</b> is \n\t\t\t<code>true</code>, the host is in a host resource group; otherwise, it is not.</p>",
"smithy.api#xmlName": "memberOfServiceLinkedResourceGroup"
}
},
"OutpostArn": {
"target": "com.amazonaws.ec2#String",
"traits": {
"aws.protocols#ec2QueryName": "OutpostArn",
"smithy.api#documentation": "<p>The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which the Dedicated Host is allocated.</p>",
"smithy.api#xmlName": "outpostArn"
}
}
},
"traits": {
Expand Down Expand Up @@ -72081,7 +72095,7 @@
"target": "com.amazonaws.ec2#StopInstancesResult"
},
"traits": {
"smithy.api#documentation": "<p>Stops an Amazon EBS-backed instance.</p>\n <p>You can use the Stop action to hibernate an instance if the instance is <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#enabling-hibernation\">enabled for\n hibernation</a> and it meets the <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites\">hibernation\n prerequisites</a>. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html\">Hibernate your instance</a> in the\n <i>Amazon EC2 User Guide</i>.</p>\n <p>We don't charge usage for a stopped instance, or data transfer fees; however, your\n root partition Amazon EBS volume remains and continues to persist your data, and you are\n charged for Amazon EBS volume usage. Every time you start your instance, Amazon EC2\n charges a one-minute minimum for instance usage, and thereafter charges per second for\n instance usage.</p>\n <p>You can't stop or hibernate instance store-backed instances. You can't use the Stop\n action to hibernate Spot Instances, but you can specify that Amazon EC2 should hibernate\n Spot Instances when they are interrupted. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html#hibernate-spot-instances\">Hibernating interrupted Spot Instances</a> in the\n <i>Amazon EC2 User Guide</i>.</p>\n <p>When you stop or hibernate an instance, we shut it down. You can restart your instance\n at any time. Before stopping or hibernating an instance, make sure it is in a state from\n which it can be restarted. Stopping an instance does not preserve data stored in RAM,\n but hibernating an instance does preserve data stored in RAM. If an instance cannot\n hibernate successfully, a normal shutdown occurs.</p>\n <p>Stopping and hibernating an instance is different to rebooting or terminating it. For\n example, when you stop or hibernate an instance, the root device and any other devices\n attached to the instance persist. When you terminate an instance, the root device and\n any other devices attached during the instance launch are automatically deleted. For\n more information about the differences between rebooting, stopping, hibernating, and\n terminating instances, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html\">Instance lifecycle</a>\n in the <i>Amazon EC2 User Guide</i>.</p>\n <p>When you stop an instance, we attempt to shut it down forcibly after a short while. If\n your instance appears stuck in the stopping state after a period of time, there may be\n an issue with the underlying host computer. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html\">Troubleshoot\n stopping your instance</a> in the <i>Amazon EC2 User Guide</i>.</p>"
"smithy.api#documentation": "<p>Stops an Amazon EBS-backed instance. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html\">Stop and start\n your instance</a> in the <i>Amazon EC2 User Guide</i>.</p>\n <p>You can use the Stop action to hibernate an instance if the instance is <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#enabling-hibernation\">enabled for\n hibernation</a> and it meets the <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites\">hibernation\n prerequisites</a>. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html\">Hibernate your instance</a> in the\n <i>Amazon EC2 User Guide</i>.</p>\n <p>We don't charge usage for a stopped instance, or data transfer fees; however, your\n root partition Amazon EBS volume remains and continues to persist your data, and you are\n charged for Amazon EBS volume usage. Every time you start your instance, Amazon EC2\n charges a one-minute minimum for instance usage, and thereafter charges per second for\n instance usage.</p>\n <p>You can't stop or hibernate instance store-backed instances. You can't use the Stop\n action to hibernate Spot Instances, but you can specify that Amazon EC2 should hibernate\n Spot Instances when they are interrupted. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html#hibernate-spot-instances\">Hibernating interrupted Spot Instances</a> in the\n <i>Amazon EC2 User Guide</i>.</p>\n <p>When you stop or hibernate an instance, we shut it down. You can restart your instance\n at any time. Before stopping or hibernating an instance, make sure it is in a state from\n which it can be restarted. Stopping an instance does not preserve data stored in RAM,\n but hibernating an instance does preserve data stored in RAM. If an instance cannot\n hibernate successfully, a normal shutdown occurs.</p>\n <p>Stopping and hibernating an instance is different to rebooting or terminating it. For\n example, when you stop or hibernate an instance, the root device and any other devices\n attached to the instance persist. When you terminate an instance, the root device and\n any other devices attached during the instance launch are automatically deleted. For\n more information about the differences between rebooting, stopping, hibernating, and\n terminating instances, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html\">Instance lifecycle</a>\n in the <i>Amazon EC2 User Guide</i>.</p>\n <p>When you stop an instance, we attempt to shut it down forcibly after a short while. If\n your instance appears stuck in the stopping state after a period of time, there may be\n an issue with the underlying host computer. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html\">Troubleshoot\n stopping your instance</a> in the <i>Amazon EC2 User Guide</i>.</p>"
}
},
"com.amazonaws.ec2#StopInstancesRequest": {
Expand Down

0 comments on commit 75a68fd

Please sign in to comment.