Skip to content

Commit

Permalink
feat(client-networkmanager): This release adds Multi Account API supp…
Browse files Browse the repository at this point in the history
…ort for a TGW Global Network, to enable and disable AWSServiceAccess with AwsOrganizations for Network Manager service and dependency CloudFormation StackSets service.
  • Loading branch information
awstools committed May 24, 2022
1 parent 097a389 commit 2b041ea
Show file tree
Hide file tree
Showing 14 changed files with 860 additions and 58 deletions.
3 changes: 1 addition & 2 deletions clients/client-networkmanager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

AWS SDK for JavaScript NetworkManager Client for Node.js, Browser and React Native.

<p>Transit Gateway Network Manager (Network Manager) enables you to create a global network, in which you can monitor your
Amazon Web Services and on-premises networks that are built around transit gateways.</p>
<p>Amazon Web Services enables you to centrally manage your Amazon Web Services Cloud WAN core network and your Transit Gateway network across Amazon Web Services accounts, Regions, and on-premises locations.</p>

## Installing

Expand Down
83 changes: 75 additions & 8 deletions clients/client-networkmanager/src/NetworkManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ import {
ListCoreNetworksCommandInput,
ListCoreNetworksCommandOutput,
} from "./commands/ListCoreNetworksCommand";
import {
ListOrganizationServiceAccessStatusCommand,
ListOrganizationServiceAccessStatusCommandInput,
ListOrganizationServiceAccessStatusCommandOutput,
} from "./commands/ListOrganizationServiceAccessStatusCommand";
import {
ListTagsForResourceCommand,
ListTagsForResourceCommandInput,
Expand Down Expand Up @@ -298,6 +303,11 @@ import {
RestoreCoreNetworkPolicyVersionCommandInput,
RestoreCoreNetworkPolicyVersionCommandOutput,
} from "./commands/RestoreCoreNetworkPolicyVersionCommand";
import {
StartOrganizationServiceAccessUpdateCommand,
StartOrganizationServiceAccessUpdateCommandInput,
StartOrganizationServiceAccessUpdateCommandOutput,
} from "./commands/StartOrganizationServiceAccessUpdateCommand";
import {
StartRouteAnalysisCommand,
StartRouteAnalysisCommandInput,
Expand Down Expand Up @@ -344,8 +354,7 @@ import {
import { NetworkManagerClient } from "./NetworkManagerClient";

/**
* <p>Transit Gateway Network Manager (Network Manager) enables you to create a global network, in which you can monitor your
* Amazon Web Services and on-premises networks that are built around transit gateways.</p>
* <p>Amazon Web Services enables you to centrally manage your Amazon Web Services Cloud WAN core network and your Transit Gateway network across Amazon Web Services accounts, Regions, and on-premises locations.</p>
*/
export class NetworkManager extends NetworkManagerClient {
/**
Expand Down Expand Up @@ -421,8 +430,8 @@ export class NetworkManager extends NetworkManagerClient {
* <p>Associates a customer gateway with a device and optionally, with a link. If you
* specify a link, it must be associated with the specified device. </p>
* <p>You can only associate customer gateways that are connected to a VPN attachment on a
* transit gateway. The transit gateway must be registered in your global network. When
* you register a transit gateway, customer gateways that are connected to the transit
* transit gateway or core network registered in your global network. When you register a
* transit gateway or core network, customer gateways that are connected to the transit
* gateway are automatically included in the global network. To list customer gateways
* that are connected to a transit gateway, use the <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpnConnections.html">DescribeVpnConnections</a> EC2 API and filter by
* <code>transit-gateway-id</code>.</p>
Expand Down Expand Up @@ -593,7 +602,7 @@ export class NetworkManager extends NetworkManagerClient {
}

/**
* <p>Creates a core network connect peer for a specified core network connect attachment between a core network and an appliance.
* <p>Creates a core network Connect peer for a specified core network connect attachment between a core network and an appliance.
* The peer address and transit gateway address must be the same IP address family (IPv4 or IPv6).</p>
*/
public createConnectPeer(
Expand Down Expand Up @@ -772,7 +781,7 @@ export class NetworkManager extends NetworkManagerClient {
}

/**
* <p>Creates a site-to-site VPN attachment on an edge location of a core network.</p>
* <p>Creates an Amazon Web Services site-to-site VPN attachment on an edge location of a core network.</p>
*/
public createSiteToSiteVpnAttachment(
args: CreateSiteToSiteVpnAttachmentCommandInput,
Expand Down Expand Up @@ -1027,7 +1036,7 @@ export class NetworkManager extends NetworkManagerClient {

/**
* <p>Deletes an existing global network. You must first delete all global network objects
* (devices, links, and sites) and deregister all transit gateways.</p>
* (devices, links, and sites), deregister all transit gateways, and delete any core networks.</p>
*/
public deleteGlobalNetwork(
args: DeleteGlobalNetworkCommandInput,
Expand Down Expand Up @@ -1503,7 +1512,7 @@ export class NetworkManager extends NetworkManagerClient {
}

/**
* <p>Returns information about a core network. By default it returns the LIVE policy.</p>
* <p>Returns information about the LIVE policy for a core network.</p>
*/
public getCoreNetwork(
args: GetCoreNetworkCommandInput,
Expand Down Expand Up @@ -2227,6 +2236,35 @@ export class NetworkManager extends NetworkManagerClient {
}
}

public listOrganizationServiceAccessStatus(
args: ListOrganizationServiceAccessStatusCommandInput,
options?: __HttpHandlerOptions
): Promise<ListOrganizationServiceAccessStatusCommandOutput>;
public listOrganizationServiceAccessStatus(
args: ListOrganizationServiceAccessStatusCommandInput,
cb: (err: any, data?: ListOrganizationServiceAccessStatusCommandOutput) => void
): void;
public listOrganizationServiceAccessStatus(
args: ListOrganizationServiceAccessStatusCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListOrganizationServiceAccessStatusCommandOutput) => void
): void;
public listOrganizationServiceAccessStatus(
args: ListOrganizationServiceAccessStatusCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListOrganizationServiceAccessStatusCommandOutput) => void),
cb?: (err: any, data?: ListOrganizationServiceAccessStatusCommandOutput) => void
): Promise<ListOrganizationServiceAccessStatusCommandOutput> | void {
const command = new ListOrganizationServiceAccessStatusCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Lists the tags for a specified resource.</p>
*/
Expand Down Expand Up @@ -2421,6 +2459,35 @@ export class NetworkManager extends NetworkManagerClient {
}
}

public startOrganizationServiceAccessUpdate(
args: StartOrganizationServiceAccessUpdateCommandInput,
options?: __HttpHandlerOptions
): Promise<StartOrganizationServiceAccessUpdateCommandOutput>;
public startOrganizationServiceAccessUpdate(
args: StartOrganizationServiceAccessUpdateCommandInput,
cb: (err: any, data?: StartOrganizationServiceAccessUpdateCommandOutput) => void
): void;
public startOrganizationServiceAccessUpdate(
args: StartOrganizationServiceAccessUpdateCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: StartOrganizationServiceAccessUpdateCommandOutput) => void
): void;
public startOrganizationServiceAccessUpdate(
args: StartOrganizationServiceAccessUpdateCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: StartOrganizationServiceAccessUpdateCommandOutput) => void),
cb?: (err: any, data?: StartOrganizationServiceAccessUpdateCommandOutput) => void
): Promise<StartOrganizationServiceAccessUpdateCommandOutput> | void {
const command = new StartOrganizationServiceAccessUpdateCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Starts analyzing the routing path between the specified source and destination. For more information,
* see <a href="https://docs.aws.amazon.com/vpc/latest/tgw/route-analyzer.html">Route Analyzer</a>.</p>
Expand Down
15 changes: 13 additions & 2 deletions clients/client-networkmanager/src/NetworkManagerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ import {
ListCoreNetworkPolicyVersionsCommandOutput,
} from "./commands/ListCoreNetworkPolicyVersionsCommand";
import { ListCoreNetworksCommandInput, ListCoreNetworksCommandOutput } from "./commands/ListCoreNetworksCommand";
import {
ListOrganizationServiceAccessStatusCommandInput,
ListOrganizationServiceAccessStatusCommandOutput,
} from "./commands/ListOrganizationServiceAccessStatusCommand";
import {
ListTagsForResourceCommandInput,
ListTagsForResourceCommandOutput,
Expand All @@ -219,6 +223,10 @@ import {
RestoreCoreNetworkPolicyVersionCommandInput,
RestoreCoreNetworkPolicyVersionCommandOutput,
} from "./commands/RestoreCoreNetworkPolicyVersionCommand";
import {
StartOrganizationServiceAccessUpdateCommandInput,
StartOrganizationServiceAccessUpdateCommandOutput,
} from "./commands/StartOrganizationServiceAccessUpdateCommand";
import { StartRouteAnalysisCommandInput, StartRouteAnalysisCommandOutput } from "./commands/StartRouteAnalysisCommand";
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
Expand Down Expand Up @@ -301,12 +309,14 @@ export type ServiceInputTypes =
| ListConnectPeersCommandInput
| ListCoreNetworkPolicyVersionsCommandInput
| ListCoreNetworksCommandInput
| ListOrganizationServiceAccessStatusCommandInput
| ListTagsForResourceCommandInput
| PutCoreNetworkPolicyCommandInput
| PutResourcePolicyCommandInput
| RegisterTransitGatewayCommandInput
| RejectAttachmentCommandInput
| RestoreCoreNetworkPolicyVersionCommandInput
| StartOrganizationServiceAccessUpdateCommandInput
| StartRouteAnalysisCommandInput
| TagResourceCommandInput
| UntagResourceCommandInput
Expand Down Expand Up @@ -379,12 +389,14 @@ export type ServiceOutputTypes =
| ListConnectPeersCommandOutput
| ListCoreNetworkPolicyVersionsCommandOutput
| ListCoreNetworksCommandOutput
| ListOrganizationServiceAccessStatusCommandOutput
| ListTagsForResourceCommandOutput
| PutCoreNetworkPolicyCommandOutput
| PutResourcePolicyCommandOutput
| RegisterTransitGatewayCommandOutput
| RejectAttachmentCommandOutput
| RestoreCoreNetworkPolicyVersionCommandOutput
| StartOrganizationServiceAccessUpdateCommandOutput
| StartRouteAnalysisCommandOutput
| TagResourceCommandOutput
| UntagResourceCommandOutput
Expand Down Expand Up @@ -551,8 +563,7 @@ type NetworkManagerClientResolvedConfigType = __SmithyResolvedConfiguration<__Ht
export interface NetworkManagerClientResolvedConfig extends NetworkManagerClientResolvedConfigType {}

/**
* <p>Transit Gateway Network Manager (Network Manager) enables you to create a global network, in which you can monitor your
* Amazon Web Services and on-premises networks that are built around transit gateways.</p>
* <p>Amazon Web Services enables you to centrally manage your Amazon Web Services Cloud WAN core network and your Transit Gateway network across Amazon Web Services accounts, Regions, and on-premises locations.</p>
*/
export class NetworkManagerClient extends __Client<
__HttpHandlerOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export interface AssociateCustomerGatewayCommandOutput extends AssociateCustomer
* <p>Associates a customer gateway with a device and optionally, with a link. If you
* specify a link, it must be associated with the specified device. </p>
* <p>You can only associate customer gateways that are connected to a VPN attachment on a
* transit gateway. The transit gateway must be registered in your global network. When
* you register a transit gateway, customer gateways that are connected to the transit
* transit gateway or core network registered in your global network. When you register a
* transit gateway or core network, customer gateways that are connected to the transit
* gateway are automatically included in the global network. To list customer gateways
* that are connected to a transit gateway, use the <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpnConnections.html">DescribeVpnConnections</a> EC2 API and filter by
* <code>transit-gateway-id</code>.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface CreateConnectPeerCommandInput extends CreateConnectPeerRequest
export interface CreateConnectPeerCommandOutput extends CreateConnectPeerResponse, __MetadataBearer {}

/**
* <p>Creates a core network connect peer for a specified core network connect attachment between a core network and an appliance.
* <p>Creates a core network Connect peer for a specified core network connect attachment between a core network and an appliance.
* The peer address and transit gateway address must be the same IP address family (IPv4 or IPv6).</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface CreateSiteToSiteVpnAttachmentCommandOutput
__MetadataBearer {}

/**
* <p>Creates a site-to-site VPN attachment on an edge location of a core network.</p>
* <p>Creates an Amazon Web Services site-to-site VPN attachment on an edge location of a core network.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface DeleteGlobalNetworkCommandOutput extends DeleteGlobalNetworkRes

/**
* <p>Deletes an existing global network. You must first delete all global network objects
* (devices, links, and sites) and deregister all transit gateways.</p>
* (devices, links, and sites), deregister all transit gateways, and delete any core networks.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface GetCoreNetworkCommandInput extends GetCoreNetworkRequest {}
export interface GetCoreNetworkCommandOutput extends GetCoreNetworkResponse, __MetadataBearer {}

/**
* <p>Returns information about a core network. By default it returns the LIVE policy.</p>
* <p>Returns information about the LIVE policy for a core network.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// smithy-typescript generated code
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 {
ListOrganizationServiceAccessStatusRequest,
ListOrganizationServiceAccessStatusResponse,
} from "../models/models_0";
import { NetworkManagerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../NetworkManagerClient";
import {
deserializeAws_restJson1ListOrganizationServiceAccessStatusCommand,
serializeAws_restJson1ListOrganizationServiceAccessStatusCommand,
} from "../protocols/Aws_restJson1";

export interface ListOrganizationServiceAccessStatusCommandInput extends ListOrganizationServiceAccessStatusRequest {}
export interface ListOrganizationServiceAccessStatusCommandOutput
extends ListOrganizationServiceAccessStatusResponse,
__MetadataBearer {}

export class ListOrganizationServiceAccessStatusCommand extends $Command<
ListOrganizationServiceAccessStatusCommandInput,
ListOrganizationServiceAccessStatusCommandOutput,
NetworkManagerClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

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

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: NetworkManagerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListOrganizationServiceAccessStatusCommandInput, ListOrganizationServiceAccessStatusCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

const { logger } = configuration;
const clientName = "NetworkManagerClient";
const commandName = "ListOrganizationServiceAccessStatusCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: ListOrganizationServiceAccessStatusRequest.filterSensitiveLog,
outputFilterSensitiveLog: ListOrganizationServiceAccessStatusResponse.filterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

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

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

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

0 comments on commit 2b041ea

Please sign in to comment.