Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[appmesh] implement Connection Pool configuration for Virtual Nodes and Virtual Gateways #11647

Closed
2 tasks
dfezzie opened this issue Nov 23, 2020 · 1 comment · Fixed by #13917
Closed
2 tasks
Assignees
Labels
@aws-cdk/aws-appmesh Related to AWS App Mesh effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Milestone

Comments

@dfezzie
Copy link
Contributor

dfezzie commented Nov 23, 2020

Use Case

Customers need to be able to configure the connection pool settings for their service. This should be implemented for both the Virtual Node and Virtual Gateway

Proposed Solution

Example implementation:

new appmesh.VirtualNode(stack, 'test-node', {
  ...
  listeners: [
    appmesh.VirtualNodeListener.http({
      port: 80,
      connectionPool: {
        maxConnections: 100,
        maxPendingRequests: 10,
      },
    }),
  ],
});

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@dfezzie dfezzie added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Nov 23, 2020
@github-actions github-actions bot added the @aws-cdk/aws-appmesh Related to AWS App Mesh label Nov 23, 2020
@skinny85 skinny85 added this to the [DevPreview] AppMesh milestone Dec 1, 2020
@skinny85 skinny85 added effort/small Small work item – less than a day of effort p2 and removed needs-triage This issue or PR still needs to be triaged. labels Dec 5, 2020
alexbrjo pushed a commit to alexbrjo/aws-cdk that referenced this issue Mar 31, 2021
@mergify mergify bot closed this as completed in #13917 Apr 16, 2021
mergify bot pushed a commit that referenced this issue Apr 16, 2021
#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 #11647

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

hollanddd pushed a commit to hollanddd/aws-cdk that referenced this issue Aug 26, 2021
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*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-appmesh Related to AWS App Mesh effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants