Skip to content

Commit

Permalink
feat(client-ec2): Adds support for SubnetConfigurations to allow user…
Browse files Browse the repository at this point in the history
…s to select their own IPv4 and IPv6 addresses for Interface VPC endpoints
  • Loading branch information
awstools committed Aug 17, 2023
1 parent 138b35b commit d377dfd
Show file tree
Hide file tree
Showing 15 changed files with 313 additions and 101 deletions.
12 changes: 10 additions & 2 deletions clients/client-ec2/src/EC2Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2067,6 +2067,7 @@ import {
resolveClientEndpointParameters,
} from "./endpoint/EndpointParameters";
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";

export { __Client };

Expand Down Expand Up @@ -3386,6 +3387,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
*/
logger?: __Logger;

/**
* Optional extensions
*/
extensions?: RuntimeExtension[];

/**
* The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
*/
Expand Down Expand Up @@ -3416,6 +3422,7 @@ export interface EC2ClientConfig extends EC2ClientConfigType {}
*/
export type EC2ClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
Required<ClientDefaults> &
RuntimeExtensionsConfig &
RegionResolvedConfig &
EndpointResolvedConfig<EndpointParameters> &
RetryResolvedConfig &
Expand Down Expand Up @@ -3479,8 +3486,9 @@ export class EC2Client extends __Client<
const _config_5 = resolveHostHeaderConfig(_config_4);
const _config_6 = resolveAwsAuthConfig(_config_5);
const _config_7 = resolveUserAgentConfig(_config_6);
super(_config_7);
this.config = _config_7;
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
super(_config_8);
this.config = _config_8;
this.middlewareStack.use(getRetryPlugin(this.config));
this.middlewareStack.use(getContentLengthPlugin(this.config));
this.middlewareStack.use(getHostHeaderPlugin(this.config));
Expand Down
7 changes: 7 additions & 0 deletions clients/client-ec2/src/clientConfiguration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// smithy-typescript generated code
import { DefaultClientConfiguration } from "@smithy/types";

/**
* @internal
*/
export interface EC2ClientConfiguration extends DefaultClientConfiguration {}
7 changes: 7 additions & 0 deletions clients/client-ec2/src/commands/CreateVpcEndpointCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ export interface CreateVpcEndpointCommandOutput extends CreateVpcEndpointResult,
* ],
* },
* ],
* SubnetConfigurations: [ // SubnetConfigurationsList
* { // SubnetConfiguration
* SubnetId: "STRING_VALUE",
* Ipv4: "STRING_VALUE",
* Ipv6: "STRING_VALUE",
* },
* ],
* };
* const command = new CreateVpcEndpointCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ import {
} from "@smithy/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import {
ImportClientVpnClientCertificateRevocationListRequest,
ImportClientVpnClientCertificateRevocationListResult,
} from "../models/models_5";
import { ImportClientVpnClientCertificateRevocationListRequest } from "../models/models_5";
import { ImportClientVpnClientCertificateRevocationListResult } from "../models/models_6";
import {
de_ImportClientVpnClientCertificateRevocationListCommand,
se_ImportClientVpnClientCertificateRevocationListCommand,
Expand Down
7 changes: 7 additions & 0 deletions clients/client-ec2/src/commands/ModifyVpcEndpointCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ export interface ModifyVpcEndpointCommandOutput extends ModifyVpcEndpointResult,
* PrivateDnsOnlyForInboundResolverEndpoint: true || false,
* },
* PrivateDnsEnabled: true || false,
* SubnetConfigurations: [ // SubnetConfigurationsList
* { // SubnetConfiguration
* SubnetId: "STRING_VALUE",
* Ipv4: "STRING_VALUE",
* Ipv6: "STRING_VALUE",
* },
* ],
* };
* const command = new ModifyVpcEndpointCommand(input);
* const response = await client.send(command);
Expand Down
62 changes: 41 additions & 21 deletions clients/client-ec2/src/models/models_2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5164,6 +5164,38 @@ export const IpAddressType = {
*/
export type IpAddressType = (typeof IpAddressType)[keyof typeof IpAddressType];

/**
* @public
* <p>Describes the configuration of a subnet for a VPC endpoint.</p>
*/
export interface SubnetConfiguration {
/**
* @public
* <p>The ID of the subnet.</p>
*/
SubnetId?: string;

/**
* @public
* <p>The IPv4 address to assign to the endpoint network interface in the subnet. You must provide
* an IPv4 address if the VPC endpoint supports IPv4.</p>
* <p>If you specify an IPv4 address when modifying a VPC endpoint, we replace the existing
* endpoint network interface with a new endpoint network interface with this IP address.
* This process temporarily disconnects the subnet and the VPC endpoint.</p>
*/
Ipv4?: string;

/**
* @public
* <p>The IPv6 address to assign to the endpoint network interface in the subnet. You must provide
* an IPv6 address if the VPC endpoint supports IPv6.</p>
* <p>If you specify an IPv6 address when modifying a VPC endpoint, we replace the existing
* endpoint network interface with a new endpoint network interface with this IP address.
* This process temporarily disconnects the subnet and the VPC endpoint.</p>
*/
Ipv6?: string;
}

/**
* @public
* @enum
Expand Down Expand Up @@ -5226,15 +5258,15 @@ export interface CreateVpcEndpointRequest {

/**
* @public
* <p>(Interface and Gateway Load Balancer endpoints) The IDs of the subnets in which to create an endpoint
* network interface. For a Gateway Load Balancer endpoint, you can specify only one subnet.</p>
* <p>(Interface and Gateway Load Balancer endpoints) The IDs of the subnets in which to create endpoint
* network interfaces. For a Gateway Load Balancer endpoint, you can specify only one subnet.</p>
*/
SubnetIds?: string[];

/**
* @public
* <p>(Interface endpoint) The IDs of the security groups to associate with the
* endpoint network interface. If this parameter is not specified, we use the default
* endpoint network interfaces. If this parameter is not specified, we use the default
* security group for the VPC.</p>
*/
SecurityGroupIds?: string[];
Expand Down Expand Up @@ -5282,6 +5314,12 @@ export interface CreateVpcEndpointRequest {
* <p>The tags to associate with the endpoint.</p>
*/
TagSpecifications?: TagSpecification[];

/**
* @public
* <p>The subnet configurations for the endpoint.</p>
*/
SubnetConfigurations?: SubnetConfiguration[];
}

/**
Expand Down Expand Up @@ -8642,24 +8680,6 @@ export const DeleteQueuedReservedInstancesErrorCode = {
export type DeleteQueuedReservedInstancesErrorCode =
(typeof DeleteQueuedReservedInstancesErrorCode)[keyof typeof DeleteQueuedReservedInstancesErrorCode];

/**
* @public
* <p>Describes the error for a Reserved Instance whose queued purchase could not be deleted.</p>
*/
export interface DeleteQueuedReservedInstancesError {
/**
* @public
* <p>The error code.</p>
*/
Code?: DeleteQueuedReservedInstancesErrorCode | string;

/**
* @public
* <p>The error message.</p>
*/
Message?: string;
}

/**
* @internal
*/
Expand Down
34 changes: 19 additions & 15 deletions clients/client-ec2/src/models/models_3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import {
TransportProtocol,
} from "./models_1";
import {
DeleteQueuedReservedInstancesError,
DeleteQueuedReservedInstancesErrorCode,
FleetStateCode,
SubnetCidrReservation,
TransitGateway,
Expand All @@ -91,6 +91,24 @@ import {
VerifiedAccessGroup,
} from "./models_2";

/**
* @public
* <p>Describes the error for a Reserved Instance whose queued purchase could not be deleted.</p>
*/
export interface DeleteQueuedReservedInstancesError {
/**
* @public
* <p>The error code.</p>
*/
Code?: DeleteQueuedReservedInstancesErrorCode | string;

/**
* @public
* <p>The error message.</p>
*/
Message?: string;
}

/**
* @public
* <p>Describes a Reserved Instance whose queued purchase was not deleted.</p>
Expand Down Expand Up @@ -10249,20 +10267,6 @@ export interface HibernationOptions {
Configured?: boolean;
}

/**
* @public
* @enum
*/
export const InstanceLifecycleType = {
scheduled: "scheduled",
spot: "spot",
} as const;

/**
* @public
*/
export type InstanceLifecycleType = (typeof InstanceLifecycleType)[keyof typeof InstanceLifecycleType];

/**
* @internal
*/
Expand Down
30 changes: 14 additions & 16 deletions clients/client-ec2/src/models/models_4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,25 @@ import {
IdFormat,
InstanceBlockDeviceMapping,
InstanceBootModeValues,
InstanceLifecycleType,
PermissionGroup,
ProductCode,
VirtualizationType,
} from "./models_3";

/**
* @public
* @enum
*/
export const InstanceLifecycleType = {
scheduled: "scheduled",
spot: "spot",
} as const;

/**
* @public
*/
export type InstanceLifecycleType = (typeof InstanceLifecycleType)[keyof typeof InstanceLifecycleType];

/**
* @public
* <p>Describes a license configuration.</p>
Expand Down Expand Up @@ -12292,21 +12305,6 @@ export interface DescribeVerifiedAccessInstanceLoggingConfigurationsRequest {
DryRun?: boolean;
}

/**
* @public
* @enum
*/
export const VerifiedAccessLogDeliveryStatusCode = {
FAILED: "failed",
SUCCESS: "success",
} as const;

/**
* @public
*/
export type VerifiedAccessLogDeliveryStatusCode =
(typeof VerifiedAccessLogDeliveryStatusCode)[keyof typeof VerifiedAccessLogDeliveryStatusCode];

/**
* @internal
*/
Expand Down
28 changes: 16 additions & 12 deletions clients/client-ec2/src/models/models_5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,22 @@ import {
StatisticType,
VirtualizationType,
} from "./models_3";
import { AnalysisStatus, ArchitectureType, VerifiedAccessLogDeliveryStatusCode } from "./models_4";
import { AnalysisStatus, ArchitectureType } from "./models_4";

/**
* @public
* @enum
*/
export const VerifiedAccessLogDeliveryStatusCode = {
FAILED: "failed",
SUCCESS: "success",
} as const;

/**
* @public
*/
export type VerifiedAccessLogDeliveryStatusCode =
(typeof VerifiedAccessLogDeliveryStatusCode)[keyof typeof VerifiedAccessLogDeliveryStatusCode];

/**
* @public
Expand Down Expand Up @@ -8541,17 +8556,6 @@ export interface ImportClientVpnClientCertificateRevocationListRequest {
DryRun?: boolean;
}

/**
* @public
*/
export interface ImportClientVpnClientCertificateRevocationListResult {
/**
* @public
* <p>Returns <code>true</code> if the request succeeds; otherwise, it returns an error.</p>
*/
Return?: boolean;
}

/**
* @internal
*/
Expand Down
Loading

0 comments on commit d377dfd

Please sign in to comment.