Skip to content

Commit

Permalink
feat(client-elasticsearch-service): Amazon OpenSearch Service now off…
Browse files Browse the repository at this point in the history
…ers managed VPC endpoints to connect to your Amazon OpenSearch Service VPC-enabled domain in a Virtual Private Cloud (VPC). This feature allows you to privately access OpenSearch Service domain without using public IPs or requiring traffic to traverse the Internet.
  • Loading branch information
awstools committed Nov 10, 2022
1 parent e1de795 commit f36b021
Show file tree
Hide file tree
Showing 15 changed files with 5,205 additions and 1,137 deletions.
335 changes: 335 additions & 0 deletions clients/client-elasticsearch-service/src/ElasticsearchService.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ import {
} from "./commands/AcceptInboundCrossClusterSearchConnectionCommand";
import { AddTagsCommandInput, AddTagsCommandOutput } from "./commands/AddTagsCommand";
import { AssociatePackageCommandInput, AssociatePackageCommandOutput } from "./commands/AssociatePackageCommand";
import {
AuthorizeVpcEndpointAccessCommandInput,
AuthorizeVpcEndpointAccessCommandOutput,
} from "./commands/AuthorizeVpcEndpointAccessCommand";
import {
CancelElasticsearchServiceSoftwareUpdateCommandInput,
CancelElasticsearchServiceSoftwareUpdateCommandOutput,
Expand All @@ -66,6 +70,7 @@ import {
CreateOutboundCrossClusterSearchConnectionCommandOutput,
} from "./commands/CreateOutboundCrossClusterSearchConnectionCommand";
import { CreatePackageCommandInput, CreatePackageCommandOutput } from "./commands/CreatePackageCommand";
import { CreateVpcEndpointCommandInput, CreateVpcEndpointCommandOutput } from "./commands/CreateVpcEndpointCommand";
import {
DeleteElasticsearchDomainCommandInput,
DeleteElasticsearchDomainCommandOutput,
Expand All @@ -83,6 +88,7 @@ import {
DeleteOutboundCrossClusterSearchConnectionCommandOutput,
} from "./commands/DeleteOutboundCrossClusterSearchConnectionCommand";
import { DeletePackageCommandInput, DeletePackageCommandOutput } from "./commands/DeletePackageCommand";
import { DeleteVpcEndpointCommandInput, DeleteVpcEndpointCommandOutput } from "./commands/DeleteVpcEndpointCommand";
import {
DescribeDomainAutoTunesCommandInput,
DescribeDomainAutoTunesCommandOutput,
Expand Down Expand Up @@ -124,6 +130,10 @@ import {
DescribeReservedElasticsearchInstancesCommandInput,
DescribeReservedElasticsearchInstancesCommandOutput,
} from "./commands/DescribeReservedElasticsearchInstancesCommand";
import {
DescribeVpcEndpointsCommandInput,
DescribeVpcEndpointsCommandOutput,
} from "./commands/DescribeVpcEndpointsCommand";
import { DissociatePackageCommandInput, DissociatePackageCommandOutput } from "./commands/DissociatePackageCommand";
import {
GetCompatibleElasticsearchVersionsCommandInput,
Expand Down Expand Up @@ -153,6 +163,15 @@ import {
ListPackagesForDomainCommandOutput,
} from "./commands/ListPackagesForDomainCommand";
import { ListTagsCommandInput, ListTagsCommandOutput } from "./commands/ListTagsCommand";
import {
ListVpcEndpointAccessCommandInput,
ListVpcEndpointAccessCommandOutput,
} from "./commands/ListVpcEndpointAccessCommand";
import { ListVpcEndpointsCommandInput, ListVpcEndpointsCommandOutput } from "./commands/ListVpcEndpointsCommand";
import {
ListVpcEndpointsForDomainCommandInput,
ListVpcEndpointsForDomainCommandOutput,
} from "./commands/ListVpcEndpointsForDomainCommand";
import {
PurchaseReservedElasticsearchInstanceOfferingCommandInput,
PurchaseReservedElasticsearchInstanceOfferingCommandOutput,
Expand All @@ -162,6 +181,10 @@ import {
RejectInboundCrossClusterSearchConnectionCommandOutput,
} from "./commands/RejectInboundCrossClusterSearchConnectionCommand";
import { RemoveTagsCommandInput, RemoveTagsCommandOutput } from "./commands/RemoveTagsCommand";
import {
RevokeVpcEndpointAccessCommandInput,
RevokeVpcEndpointAccessCommandOutput,
} from "./commands/RevokeVpcEndpointAccessCommand";
import {
StartElasticsearchServiceSoftwareUpdateCommandInput,
StartElasticsearchServiceSoftwareUpdateCommandOutput,
Expand All @@ -171,6 +194,7 @@ import {
UpdateElasticsearchDomainConfigCommandOutput,
} from "./commands/UpdateElasticsearchDomainConfigCommand";
import { UpdatePackageCommandInput, UpdatePackageCommandOutput } from "./commands/UpdatePackageCommand";
import { UpdateVpcEndpointCommandInput, UpdateVpcEndpointCommandOutput } from "./commands/UpdateVpcEndpointCommand";
import {
UpgradeElasticsearchDomainCommandInput,
UpgradeElasticsearchDomainCommandOutput,
Expand All @@ -187,15 +211,18 @@ export type ServiceInputTypes =
| AcceptInboundCrossClusterSearchConnectionCommandInput
| AddTagsCommandInput
| AssociatePackageCommandInput
| AuthorizeVpcEndpointAccessCommandInput
| CancelElasticsearchServiceSoftwareUpdateCommandInput
| CreateElasticsearchDomainCommandInput
| CreateOutboundCrossClusterSearchConnectionCommandInput
| CreatePackageCommandInput
| CreateVpcEndpointCommandInput
| DeleteElasticsearchDomainCommandInput
| DeleteElasticsearchServiceRoleCommandInput
| DeleteInboundCrossClusterSearchConnectionCommandInput
| DeleteOutboundCrossClusterSearchConnectionCommandInput
| DeletePackageCommandInput
| DeleteVpcEndpointCommandInput
| DescribeDomainAutoTunesCommandInput
| DescribeDomainChangeProgressCommandInput
| DescribeElasticsearchDomainCommandInput
Expand All @@ -207,6 +234,7 @@ export type ServiceInputTypes =
| DescribePackagesCommandInput
| DescribeReservedElasticsearchInstanceOfferingsCommandInput
| DescribeReservedElasticsearchInstancesCommandInput
| DescribeVpcEndpointsCommandInput
| DissociatePackageCommandInput
| GetCompatibleElasticsearchVersionsCommandInput
| GetPackageVersionHistoryCommandInput
Expand All @@ -218,27 +246,35 @@ export type ServiceInputTypes =
| ListElasticsearchVersionsCommandInput
| ListPackagesForDomainCommandInput
| ListTagsCommandInput
| ListVpcEndpointAccessCommandInput
| ListVpcEndpointsCommandInput
| ListVpcEndpointsForDomainCommandInput
| PurchaseReservedElasticsearchInstanceOfferingCommandInput
| RejectInboundCrossClusterSearchConnectionCommandInput
| RemoveTagsCommandInput
| RevokeVpcEndpointAccessCommandInput
| StartElasticsearchServiceSoftwareUpdateCommandInput
| UpdateElasticsearchDomainConfigCommandInput
| UpdatePackageCommandInput
| UpdateVpcEndpointCommandInput
| UpgradeElasticsearchDomainCommandInput;

export type ServiceOutputTypes =
| AcceptInboundCrossClusterSearchConnectionCommandOutput
| AddTagsCommandOutput
| AssociatePackageCommandOutput
| AuthorizeVpcEndpointAccessCommandOutput
| CancelElasticsearchServiceSoftwareUpdateCommandOutput
| CreateElasticsearchDomainCommandOutput
| CreateOutboundCrossClusterSearchConnectionCommandOutput
| CreatePackageCommandOutput
| CreateVpcEndpointCommandOutput
| DeleteElasticsearchDomainCommandOutput
| DeleteElasticsearchServiceRoleCommandOutput
| DeleteInboundCrossClusterSearchConnectionCommandOutput
| DeleteOutboundCrossClusterSearchConnectionCommandOutput
| DeletePackageCommandOutput
| DeleteVpcEndpointCommandOutput
| DescribeDomainAutoTunesCommandOutput
| DescribeDomainChangeProgressCommandOutput
| DescribeElasticsearchDomainCommandOutput
Expand All @@ -250,6 +286,7 @@ export type ServiceOutputTypes =
| DescribePackagesCommandOutput
| DescribeReservedElasticsearchInstanceOfferingsCommandOutput
| DescribeReservedElasticsearchInstancesCommandOutput
| DescribeVpcEndpointsCommandOutput
| DissociatePackageCommandOutput
| GetCompatibleElasticsearchVersionsCommandOutput
| GetPackageVersionHistoryCommandOutput
Expand All @@ -261,12 +298,17 @@ export type ServiceOutputTypes =
| ListElasticsearchVersionsCommandOutput
| ListPackagesForDomainCommandOutput
| ListTagsCommandOutput
| ListVpcEndpointAccessCommandOutput
| ListVpcEndpointsCommandOutput
| ListVpcEndpointsForDomainCommandOutput
| PurchaseReservedElasticsearchInstanceOfferingCommandOutput
| RejectInboundCrossClusterSearchConnectionCommandOutput
| RemoveTagsCommandOutput
| RevokeVpcEndpointAccessCommandOutput
| StartElasticsearchServiceSoftwareUpdateCommandOutput
| UpdateElasticsearchDomainConfigCommandOutput
| UpdatePackageCommandOutput
| UpdateVpcEndpointCommandOutput
| UpgradeElasticsearchDomainCommandOutput;

export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
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 {
ElasticsearchServiceClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes,
} from "../ElasticsearchServiceClient";
import {
AuthorizeVpcEndpointAccessRequest,
AuthorizeVpcEndpointAccessRequestFilterSensitiveLog,
AuthorizeVpcEndpointAccessResponse,
AuthorizeVpcEndpointAccessResponseFilterSensitiveLog,
} from "../models/models_0";
import {
deserializeAws_restJson1AuthorizeVpcEndpointAccessCommand,
serializeAws_restJson1AuthorizeVpcEndpointAccessCommand,
} from "../protocols/Aws_restJson1";

export interface AuthorizeVpcEndpointAccessCommandInput extends AuthorizeVpcEndpointAccessRequest {}
export interface AuthorizeVpcEndpointAccessCommandOutput extends AuthorizeVpcEndpointAccessResponse, __MetadataBearer {}

/**
* <p>Provides access to an Amazon OpenSearch Service domain through the use of an interface VPC endpoint.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ElasticsearchServiceClient, AuthorizeVpcEndpointAccessCommand } from "@aws-sdk/client-elasticsearch-service"; // ES Modules import
* // const { ElasticsearchServiceClient, AuthorizeVpcEndpointAccessCommand } = require("@aws-sdk/client-elasticsearch-service"); // CommonJS import
* const client = new ElasticsearchServiceClient(config);
* const command = new AuthorizeVpcEndpointAccessCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link AuthorizeVpcEndpointAccessCommandInput} for command's `input` shape.
* @see {@link AuthorizeVpcEndpointAccessCommandOutput} for command's `response` shape.
* @see {@link ElasticsearchServiceClientResolvedConfig | config} for ElasticsearchServiceClient's `config` shape.
*
*/
export class AuthorizeVpcEndpointAccessCommand extends $Command<
AuthorizeVpcEndpointAccessCommandInput,
AuthorizeVpcEndpointAccessCommandOutput,
ElasticsearchServiceClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

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

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: ElasticsearchServiceClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<AuthorizeVpcEndpointAccessCommandInput, AuthorizeVpcEndpointAccessCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, AuthorizeVpcEndpointAccessCommand.getEndpointParameterInstructions())
);

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

const { logger } = configuration;
const clientName = "ElasticsearchServiceClient";
const commandName = "AuthorizeVpcEndpointAccessCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: AuthorizeVpcEndpointAccessRequestFilterSensitiveLog,
outputFilterSensitiveLog: AuthorizeVpcEndpointAccessResponseFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

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

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

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

0 comments on commit f36b021

Please sign in to comment.