forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(appmesh): add Connection Pools for VirtualNode and VirtualGateway (
aws#13917) Adds connection pools to VirtualNodes and VirtualGateways. VirtualNodes support listeners for HTTP, HTTP2, gRPC and TPC. VirtualGateways support only HTTP, HTTP2 and gRPC (no TCP). There are connection pool configurations for each of these 7 node/protocol combinations. * HTTP connection pools need these properties: maxConnections, maxPendingRequests * HTTP2 connection pools need these properties: maxRequests * gRPC connection pools need these properties: maxRequests * TCP connection pools need these properties: maxConnections Since connection pool properties differ by protocol so it's important to enforce the correct fields in CDK. To accomplish this I've added interfaces per protocol type and squashed API config `ConnectionPool > [Protocol] > properties` to the equivalent `ConnectionPool > properties` CDK config. This is ok because the user will never mismatch protocol types. From [docs (see connection pool section)](https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_gateways.html): > The connectionPool and portMapping protocols must be the same. If your listener protocol is grpc or http2, specify maxRequests only. If your listener protocol is http, you can specify both maxConnections and maxPendingRequests. ```ts new appmesh.VirtualNode(stack, 'test-node', { mesh, listeners: [ appmesh.VirtualNodeListener.tcp({ port: 80, connectionPool: { maxConnections: 100, }, }), ], }); ``` Pre-addressing the `ConnectionPoolConfig` placeholder interface & lint ignore statement: I’ve added this so I can treat the connection pool types as sub-classes while taking advantage of the interface object literal pattern. Cleaner UX compared to using classes. BREAKING CHANGE: HTTP2 `VirtualNodeListener`s must be now created with `Http2VirtualNodeListenerOptions` * **appmesh**: HTTP2 `VirtualGatewayListener`s must be now created with `Http2VirtualGatewayListenerOptions` Closes aws#11647 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
7 changed files
with
512 additions
and
33 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
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.