-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Open
Labels
@aws-cdk/aws-ecs-patternsRelated to ecs-patterns libraryRelated to ecs-patterns librarybugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp1
Description
What is the problem?
The ecs-patterns README states that 'Instead of providing a cluster you can specify a VPC and CDK will create a new ECS cluster.' However, omiting the cluster prop and only provided a vpc results in an error. And there is not clear direction on how to do this properly.
So far I have noticed this issue with the following constructs. It might apply to more.
- NetworkMultipleTargetGroupsEc2Service
- ApplicationMultipleTargetGroupsEc2Service
- ApplicationLoadBalancedEc2Service
This might just be a miss in the documentation, and not missing functionality. I will need to dive deeper into this to find out.
Reproduction Steps
Synthesize and app with this sample code:
const stack = new Stack();
const vpc = new Vpc(stack, 'VPC');
const service = new ApplicationMultipleTargetGroupsEc2Service(stack, 'Service', {
vpc,
memoryLimitMiB: 1024,
taskImageOptions: {
image: ContainerImage.fromRegistry('test'),
},
});
What did you expect to happen?
No errors, and it synthesizes an ECS service with a cluster created by the CDK.
What actually happened?
I get this error:
[Default/Service/Service] Cluster for this service needs Ec2 capacity. Call addXxxCapacity() on the cluster.
CDK CLI Version
1.139.0
Framework Version
No response
Node.js Version
12.22.7
OS
MacOS
Language
Typescript
Language Version
No response
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-ecs-patternsRelated to ecs-patterns libraryRelated to ecs-patterns librarybugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp1