-
Notifications
You must be signed in to change notification settings - Fork 589
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-ec2): Added support for ModifyInstanceMetadataDefaults an…
…d GetInstanceMetadataDefaults to set Instance Metadata Service account defaults
- Loading branch information
awstools
committed
Mar 25, 2024
1 parent
92aa194
commit cdacf23
Showing
17 changed files
with
1,184 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
clients/client-ec2/src/commands/GetInstanceMetadataDefaultsCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// 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 { GetInstanceMetadataDefaultsRequest, GetInstanceMetadataDefaultsResult } from "../models/models_5"; | ||
import { de_GetInstanceMetadataDefaultsCommand, se_GetInstanceMetadataDefaultsCommand } from "../protocols/Aws_ec2"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { __MetadataBearer, $Command }; | ||
/** | ||
* @public | ||
* | ||
* The input for {@link GetInstanceMetadataDefaultsCommand}. | ||
*/ | ||
export interface GetInstanceMetadataDefaultsCommandInput extends GetInstanceMetadataDefaultsRequest {} | ||
/** | ||
* @public | ||
* | ||
* The output of {@link GetInstanceMetadataDefaultsCommand}. | ||
*/ | ||
export interface GetInstanceMetadataDefaultsCommandOutput extends GetInstanceMetadataDefaultsResult, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Gets the default instance metadata service (IMDS) settings that are set at the account | ||
* level in the specified Amazon Web Services Region.</p> | ||
* <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html#instance-metadata-options-order-of-precedence">Order of precedence for instance metadata options</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 | ||
* import { EC2Client, GetInstanceMetadataDefaultsCommand } from "@aws-sdk/client-ec2"; // ES Modules import | ||
* // const { EC2Client, GetInstanceMetadataDefaultsCommand } = require("@aws-sdk/client-ec2"); // CommonJS import | ||
* const client = new EC2Client(config); | ||
* const input = { // GetInstanceMetadataDefaultsRequest | ||
* DryRun: true || false, | ||
* }; | ||
* const command = new GetInstanceMetadataDefaultsCommand(input); | ||
* const response = await client.send(command); | ||
* // { // GetInstanceMetadataDefaultsResult | ||
* // AccountLevel: { // InstanceMetadataDefaultsResponse | ||
* // HttpTokens: "optional" || "required", | ||
* // HttpPutResponseHopLimit: Number("int"), | ||
* // HttpEndpoint: "disabled" || "enabled", | ||
* // InstanceMetadataTags: "disabled" || "enabled", | ||
* // }, | ||
* // }; | ||
* | ||
* ``` | ||
* | ||
* @param GetInstanceMetadataDefaultsCommandInput - {@link GetInstanceMetadataDefaultsCommandInput} | ||
* @returns {@link GetInstanceMetadataDefaultsCommandOutput} | ||
* @see {@link GetInstanceMetadataDefaultsCommandInput} for command's `input` shape. | ||
* @see {@link GetInstanceMetadataDefaultsCommandOutput} 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 GetInstanceMetadataDefaultsCommand extends $Command | ||
.classBuilder< | ||
GetInstanceMetadataDefaultsCommandInput, | ||
GetInstanceMetadataDefaultsCommandOutput, | ||
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", "GetInstanceMetadataDefaults", {}) | ||
.n("EC2Client", "GetInstanceMetadataDefaultsCommand") | ||
.f(void 0, void 0) | ||
.ser(se_GetInstanceMetadataDefaultsCommand) | ||
.de(de_GetInstanceMetadataDefaultsCommand) | ||
.build() {} |
97 changes: 97 additions & 0 deletions
97
clients/client-ec2/src/commands/ModifyInstanceMetadataDefaultsCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// 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 { ModifyInstanceMetadataDefaultsRequest, ModifyInstanceMetadataDefaultsResult } from "../models/models_6"; | ||
import { | ||
de_ModifyInstanceMetadataDefaultsCommand, | ||
se_ModifyInstanceMetadataDefaultsCommand, | ||
} from "../protocols/Aws_ec2"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { __MetadataBearer, $Command }; | ||
/** | ||
* @public | ||
* | ||
* The input for {@link ModifyInstanceMetadataDefaultsCommand}. | ||
*/ | ||
export interface ModifyInstanceMetadataDefaultsCommandInput extends ModifyInstanceMetadataDefaultsRequest {} | ||
/** | ||
* @public | ||
* | ||
* The output of {@link ModifyInstanceMetadataDefaultsCommand}. | ||
*/ | ||
export interface ModifyInstanceMetadataDefaultsCommandOutput | ||
extends ModifyInstanceMetadataDefaultsResult, | ||
__MetadataBearer {} | ||
|
||
/** | ||
* <p>Modifies the default instance metadata service (IMDS) settings at the account level in | ||
* the specified Amazon Web Services Region.</p> | ||
* <note> | ||
* <p>To remove a parameter's account-level default setting, specify | ||
* <code>no-preference</code>. At instance launch, the value will come from the | ||
* AMI, or from the launch parameter if specified. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html#instance-metadata-options-order-of-precedence">Order of precedence for instance metadata 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, ModifyInstanceMetadataDefaultsCommand } from "@aws-sdk/client-ec2"; // ES Modules import | ||
* // const { EC2Client, ModifyInstanceMetadataDefaultsCommand } = require("@aws-sdk/client-ec2"); // CommonJS import | ||
* const client = new EC2Client(config); | ||
* const input = { // ModifyInstanceMetadataDefaultsRequest | ||
* HttpTokens: "optional" || "required" || "no-preference", | ||
* HttpPutResponseHopLimit: Number("int"), | ||
* HttpEndpoint: "disabled" || "enabled" || "no-preference", | ||
* InstanceMetadataTags: "disabled" || "enabled" || "no-preference", | ||
* DryRun: true || false, | ||
* }; | ||
* const command = new ModifyInstanceMetadataDefaultsCommand(input); | ||
* const response = await client.send(command); | ||
* // { // ModifyInstanceMetadataDefaultsResult | ||
* // Return: true || false, | ||
* // }; | ||
* | ||
* ``` | ||
* | ||
* @param ModifyInstanceMetadataDefaultsCommandInput - {@link ModifyInstanceMetadataDefaultsCommandInput} | ||
* @returns {@link ModifyInstanceMetadataDefaultsCommandOutput} | ||
* @see {@link ModifyInstanceMetadataDefaultsCommandInput} for command's `input` shape. | ||
* @see {@link ModifyInstanceMetadataDefaultsCommandOutput} 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 ModifyInstanceMetadataDefaultsCommand extends $Command | ||
.classBuilder< | ||
ModifyInstanceMetadataDefaultsCommandInput, | ||
ModifyInstanceMetadataDefaultsCommandOutput, | ||
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", "ModifyInstanceMetadataDefaults", {}) | ||
.n("EC2Client", "ModifyInstanceMetadataDefaultsCommand") | ||
.f(void 0, void 0) | ||
.ser(se_ModifyInstanceMetadataDefaultsCommand) | ||
.de(de_ModifyInstanceMetadataDefaultsCommand) | ||
.build() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.