Future `NextjsRegionalContainers` Refactor
- Dominant language
- TypeScript
- Stars
- 108
- Forks
- 12
- Avg merge
- 1h 30m
- Merged PRs (30d)
- 7
Description
`NextjsRegionalContainers` currently uses ALB. ALB can be expensive and does not have HTTPS by default which is annoying. An alternative would be to use API Gateway with VPC Link + private integration using AWS Cloud Map service discovery. Plus, API Gateway enables use of mapping templates that send static requests directly to S3 for faster perf and reduce load on containers! BUT API Gateway does not currently support streaming :/ And only HTTP APIs support VPC Link Cloud Map integration and HTTP APIs (unlike REST APIs) don't support WAF which is required for many customers.
See blog: [Field Notes: Integrating HTTP APIs with AWS Cloud Map and Amazon ECS Services](https://aws.amazon.com/blogs/architecture/field-notes-integrating-http-apis-with-aws-cloud-map-and-amazon-ecs-services/).
If only API Gateway REST APIs supported those features!
Can we improve `NextjsGlobalContainers` with this strategy? Ideally CloudFront VPC Origins would support AWS Cloud Map service discovery but it does not. However, we could use REST API with VPC Link + private integration using AWS Cloud Map service discovery if it supported in future to replace ALB! However, REST APIs would be exposed publicly (CloudFront Origin VPC doesn't target Private REST APIs), so we'd need to implement authorization technique like [Restricting access on HTTP API Gateway Endpoint with Lambda Authorizer](https://aws.amazon.com/blogs/networking-and-content-delivery/restricting-access-http-api-gateway-lambda-authorizer/) which is annoying but not terrible.
Cost comparison: $1.00/month (HTTP API) vs $30/month (ALB)
Contributor guide
Research direction
Start by locating the `NextjsRegionalContainers` and `NextjsGlobalContainers` entry points and reading how the current ALB integration is configured. Verify the stated API Gateway, VPC Link, Cloud Map, CloudFront, WAF, and streaming constraints against the supported AWS services. Done would require a settled, implementable architecture and explicit scope; the issue currently does not define either.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, nextjs, typescript
- Domain
- api, cloud, infrastructure
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100