aws / aws/aws-cdk

aws-ecs-patterns: Add ApiGatewayLoadBalancedFargateService L3 construct

Open
#26,435 2 comments 11 reactions 0 assignees View on GitHub
@aws-cdk/aws-ecs-patterns feature-request p3
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
74

Description

### Describe the feature

Running Fargate services with API Gateway and Cloud Map without using ALB/NLB is a pattern that has been [published](https://aws.amazon.com/blogs/architecture/field-notes-integrating-http-apis-with-aws-cloud-map-and-amazon-ecs-services/) in AWS Architecture Blog. The container team recently has [included](https://containersonaws.com/pattern/ecs-fargate-apigateway-cloudmap-cdk) this pattern into the containersonaws.com website. I recently discussed this with @nathanpeck and we believe we should include this new L3 pattern into [aws-ecs-patterns](https://github.com/aws/aws-cdk/tree/main/packages/aws-cdk-lib/aws-ecs-patterns).

### Use Case

To allow users to provision Fargate services with API Gateway as the frontend load balancer and Cloud Map as the service discovery.

### Proposed Solution

Include the `ApiGatewayLoadBalancedFargateService` in the aws-ecs-patterns module and the user experience would be like

```ts
import { ApiGatewayLoadBalancedFargateService } from 'aws-cdk-lib/aws-ecs-patterns';

new ApiGatewayLoadBalancedFargateService(stack, 'DemoService', {
vpc,
cluster,
taskDefinition,
desiredCount: 2,
vpcLinkIntegration: VpcLinkIntegration.CLOUDMAP,
});
}
```

### Other Information

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/

API Gateway load balanced Fargate service with Cloud Map using CDK construct
https://containersonaws.com/pattern/ecs-fargate-apigateway-cloudmap-cdk

### Acknowledgements

- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.87.0

### Environment details (OS name and version, etc.)

mac os x

Contributor guide

Open the contributing guide

Research direction

Start in packages/aws-cdk-lib/aws-ecs-patterns and review the proposed ApiGatewayLoadBalancedFargateService usage. Read the two linked AWS pattern references to understand the API Gateway, Fargate, and Cloud Map combination. Done means the new L3 pattern is included in aws-ecs-patterns and supports the described service-discovery use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
backend-api-design, cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.