Skip to content

Commit

Permalink
feat(client-ec2): Adding an imdsSupport attribute to EC2 AMIs
Browse files Browse the repository at this point in the history
  • Loading branch information
awstools committed Oct 3, 2022
1 parent 22500bf commit 7304adf
Show file tree
Hide file tree
Showing 8 changed files with 249 additions and 160 deletions.
Expand Up @@ -13,8 +13,12 @@ import {
} from "@aws-sdk/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { DescribeLocalGatewaysRequest, DescribeLocalGatewaysRequestFilterSensitiveLog } from "../models/models_3";
import { DescribeLocalGatewaysResult, DescribeLocalGatewaysResultFilterSensitiveLog } from "../models/models_4";
import {
DescribeLocalGatewaysRequest,
DescribeLocalGatewaysRequestFilterSensitiveLog,
DescribeLocalGatewaysResult,
DescribeLocalGatewaysResultFilterSensitiveLog,
} from "../models/models_4";
import {
deserializeAws_ec2DescribeLocalGatewaysCommand,
serializeAws_ec2DescribeLocalGatewaysCommand,
Expand Down
Expand Up @@ -13,12 +13,8 @@ import {
} from "@aws-sdk/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import {
ModifyVpnTunnelOptionsRequest,
ModifyVpnTunnelOptionsRequestFilterSensitiveLog,
ModifyVpnTunnelOptionsResult,
ModifyVpnTunnelOptionsResultFilterSensitiveLog,
} from "../models/models_5";
import { ModifyVpnTunnelOptionsRequest, ModifyVpnTunnelOptionsRequestFilterSensitiveLog } from "../models/models_5";
import { ModifyVpnTunnelOptionsResult, ModifyVpnTunnelOptionsResultFilterSensitiveLog } from "../models/models_6";
import {
deserializeAws_ec2ModifyVpnTunnelOptionsCommand,
serializeAws_ec2ModifyVpnTunnelOptionsCommand,
Expand Down
80 changes: 25 additions & 55 deletions clients/client-ec2/src/models/models_3.ts
Expand Up @@ -4899,6 +4899,7 @@ export enum ImageAttributeName {
blockDeviceMapping = "blockDeviceMapping",
bootMode = "bootMode",
description = "description",
imdsSupport = "imdsSupport",
kernel = "kernel",
lastLaunchedTime = "lastLaunchedTime",
launchPermission = "launchPermission",
Expand Down Expand Up @@ -5034,6 +5035,16 @@ export interface ImageAttribute {
* </note>
*/
LastLaunchedTime?: AttributeValue;

/**
* <p>If <code>v2.0</code>, it indicates that IMDSv2 is specified in the AMI. Instances launched
* from this AMI will have <code>HttpTokens</code> automatically set to <code>required</code> so
* that, by default, the instance requires that IMDSv2 is used when requesting instance metadata.
* In addition, <code>HttpPutResponseHopLimit</code> is set to <code>2</code>. For more
* information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration">Configure
* the AMI</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
*/
ImdsSupport?: AttributeValue;
}

export interface DescribeImagesRequest {
Expand Down Expand Up @@ -5273,6 +5284,10 @@ export enum ImageTypeValues {
ramdisk = "ramdisk",
}

export enum ImdsSupportValues {
v2_0 = "v2.0",
}

export enum DeviceType {
ebs = "ebs",
instance_store = "instance-store",
Expand Down Expand Up @@ -5462,6 +5477,16 @@ export interface Image {
* nearest minute.</p>
*/
DeprecationTime?: string;

/**
* <p>If <code>v2.0</code>, it indicates that IMDSv2 is specified in the AMI. Instances launched
* from this AMI will have <code>HttpTokens</code> automatically set to <code>required</code> so
* that, by default, the instance requires that IMDSv2 is used when requesting instance metadata.
* In addition, <code>HttpPutResponseHopLimit</code> is set to <code>2</code>. For more
* information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration">Configure
* the AMI</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
*/
ImdsSupport?: ImdsSupportValues | string;
}

export interface DescribeImagesResult {
Expand Down Expand Up @@ -9680,54 +9705,6 @@ export interface DescribeLocalGatewayRouteTableVpcAssociationsResult {
NextToken?: string;
}

export interface DescribeLocalGatewaysRequest {
/**
* <p>The IDs of the local gateways.</p>
*/
LocalGatewayIds?: string[];

/**
* <p>One or more filters.</p>
* <ul>
* <li>
* <p>
* <code>local-gateway-id</code> - The ID of a local gateway.</p>
* </li>
* <li>
* <p>
* <code>outpost-arn</code> - The Amazon Resource Name (ARN) of the Outpost.</p>
* </li>
* <li>
* <p>
* <code>owner-id</code> - The ID of the Amazon Web Services account that owns the local gateway.</p>
* </li>
* <li>
* <p>
* <code>state</code> - The state of the association.</p>
* </li>
* </ul>
*/
Filters?: Filter[];

/**
* <p>The maximum number of results to return with a single call.
* To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>
*/
MaxResults?: number;

/**
* <p>The token for the next page of results.</p>
*/
NextToken?: string;

/**
* <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>
*/
DryRun?: boolean;
}

/**
* @internal
*/
Expand Down Expand Up @@ -11499,10 +11476,3 @@ export const DescribeLocalGatewayRouteTableVpcAssociationsResultFilterSensitiveL
): any => ({
...obj,
});

/**
* @internal
*/
export const DescribeLocalGatewaysRequestFilterSensitiveLog = (obj: DescribeLocalGatewaysRequest): any => ({
...obj,
});
130 changes: 52 additions & 78 deletions clients/client-ec2/src/models/models_4.ts
Expand Up @@ -109,6 +109,54 @@ import {
ProductCode,
} from "./models_3";

export interface DescribeLocalGatewaysRequest {
/**
* <p>The IDs of the local gateways.</p>
*/
LocalGatewayIds?: string[];

/**
* <p>One or more filters.</p>
* <ul>
* <li>
* <p>
* <code>local-gateway-id</code> - The ID of a local gateway.</p>
* </li>
* <li>
* <p>
* <code>outpost-arn</code> - The Amazon Resource Name (ARN) of the Outpost.</p>
* </li>
* <li>
* <p>
* <code>owner-id</code> - The ID of the Amazon Web Services account that owns the local gateway.</p>
* </li>
* <li>
* <p>
* <code>state</code> - The state of the association.</p>
* </li>
* </ul>
*/
Filters?: Filter[];

/**
* <p>The maximum number of results to return with a single call.
* To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>
*/
MaxResults?: number;

/**
* <p>The token for the next page of results.</p>
*/
NextToken?: string;

/**
* <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>
*/
DryRun?: boolean;
}

/**
* <p>Describes a local gateway.</p>
*/
Expand Down Expand Up @@ -9712,76 +9760,11 @@ export interface EnableFastSnapshotRestoresRequest {
}

/**
* <p>Describes fast snapshot restores that were successfully enabled.</p>
* @internal
*/
export interface EnableFastSnapshotRestoreSuccessItem {
/**
* <p>The ID of the snapshot.</p>
*/
SnapshotId?: string;

/**
* <p>The Availability Zone.</p>
*/
AvailabilityZone?: string;

/**
* <p>The state of fast snapshot restores.</p>
*/
State?: FastSnapshotRestoreStateCode | string;

/**
* <p>The reason for the state transition. The possible values are as follows:</p>
* <ul>
* <li>
* <p>
* <code>Client.UserInitiated</code> - The state successfully transitioned to <code>enabling</code> or
* <code>disabling</code>.</p>
* </li>
* <li>
* <p>
* <code>Client.UserInitiated - Lifecycle state transition</code> - The state successfully transitioned
* to <code>optimizing</code>, <code>enabled</code>, or <code>disabled</code>.</p>
* </li>
* </ul>
*/
StateTransitionReason?: string;

/**
* <p>The ID of the Amazon Web Services account that enabled fast snapshot restores on the snapshot.</p>
*/
OwnerId?: string;

/**
* <p>The Amazon Web Services owner alias that enabled fast snapshot restores on the snapshot. This is intended for future use.</p>
*/
OwnerAlias?: string;

/**
* <p>The time at which fast snapshot restores entered the <code>enabling</code> state.</p>
*/
EnablingTime?: Date;

/**
* <p>The time at which fast snapshot restores entered the <code>optimizing</code> state.</p>
*/
OptimizingTime?: Date;

/**
* <p>The time at which fast snapshot restores entered the <code>enabled</code> state.</p>
*/
EnabledTime?: Date;

/**
* <p>The time at which fast snapshot restores entered the <code>disabling</code> state.</p>
*/
DisablingTime?: Date;

/**
* <p>The time at which fast snapshot restores entered the <code>disabled</code> state.</p>
*/
DisabledTime?: Date;
}
export const DescribeLocalGatewaysRequestFilterSensitiveLog = (obj: DescribeLocalGatewaysRequest): any => ({
...obj,
});

/**
* @internal
Expand Down Expand Up @@ -11918,12 +11901,3 @@ export const EnableFastLaunchResultFilterSensitiveLog = (obj: EnableFastLaunchRe
export const EnableFastSnapshotRestoresRequestFilterSensitiveLog = (obj: EnableFastSnapshotRestoresRequest): any => ({
...obj,
});

/**
* @internal
*/
export const EnableFastSnapshotRestoreSuccessItemFilterSensitiveLog = (
obj: EnableFastSnapshotRestoreSuccessItem
): any => ({
...obj,
});

0 comments on commit 7304adf

Please sign in to comment.