Please comment with any new patterns that you would like to see (Specific to ECS). Please provide the following in each comment:
why do you need this feature/what would it be used for(scenarios)?
If you have a solution proposal
Any additional information
I want an AWS App Mesh enabled ECS service as a pattern: https://github.com/aws/aws-cdk/issues/4566
I also want a REST API pattern, where multiple services can be mounted onto different paths on an ALB like:
/api/users -> users service
/api/orders -> order service
I'd like to have a resilient scheduled Fargate task as described here: https://cloudonaut.io/resilient-task-scheduling-with-ecs-fargate-cron-scheduled-task/
tldr; it uses Step Functions instead of CloudWatch Rules
Use Case
I'd like to use a pre-existing load balancer listener for multiple ECS services that are differentiated by ALB rules and rule priorities.
Proposed Solution
Add a listener
prop to ApplicationLoadBalancedServiceBaseProps
which identifies which load balancer listener rules should be added to and an addListenerRule(rule: ApplicationTargetProps)
method to ApplicationLoadBalancedEc2Service
and ApplicationLoadBalancedFargateService
. When addListenerRule() is called, the pattern construct would add ApplicationListenerRule
s that reference the listener
specified in the constructor props.
const loadBalancedEcsService = new ecsPatterns.ApplicationLoadBalancedEc2Service(stack, 'Service', {
cluster,
// New prop:
listener: albListener,
memoryLimitMiB: 1024,
taskImageOptions: {
image: ecs.ContainerImage.fromRegistry('test'),
},
});
// New method:
loadBalancedEcsService.addListenerRule({
containerPort: 80,
hostHeader: "something.example.com",
priority: 10,
});
Most helpful comment
I also want a REST API pattern, where multiple services can be mounted onto different paths on an ALB like:
/api/users -> users service
/api/orders -> order service