aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.71k stars 3.93k forks source link

aws-ecs-patterns: Add ApiGatewayLoadBalancedFargateService L3 construct #26435

Open pahud opened 1 year ago

pahud commented 1 year ago

Describe the feature

Running Fargate services with API Gateway and Cloud Map without using ALB/NLB is a pattern that has been published in AWS Architecture Blog. The container team recently has included 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.

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

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

CDK version used

2.87.0

Environment details (OS name and version, etc.)

mac os x

nathanpeck commented 1 year ago

I support this as a new pattern. It will be ideal for low traffic, low cost deployments for dev or learner workloads. The baseline cost will be much lower than our existing patterns, as API Gateway does not have an constant hourly charge like the other load balancers in our other patterns do

BwL1289 commented 8 months ago

@pahud has there been any progress on this or a release ETA?