-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[aws-ecs-patterns] Cannot Create ApplicationLoadBalancedEc2Service Separate From Cluster #4267
Comments
Hi @jd-carroll, thanks for discovering this issue! Error reasonPasses the cluster as a parameter in creating the ecs_pattern construct so the However, if no load balancer is provided, a new load balancer will be created by default and the Solutions
const lb = new elbv2.ApplicationLoadBalancer(clusterStack, 'lb', { vpc });
// ---- Create a service stack defining some task
const serviceStack = new cdk.Stack(app, 'aws-ecs-service-stack');
new ecs_patterns.ApplicationLoadBalancedEc2Service(serviceStack, 'InboundSmtpAppService', {
cluster,
memoryLimitMiB: 512,
taskImageOptions: {
image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample")
},
loadBalancer: lb
});
SuggestionFor now I think solution 1 can help you solve this problem. However, we should discuss if this behavior is a common use case (separating as |
@pkandasamy91 any thoughts on this? |
@iamhopaul123 thanks for investigating the issue! I think the first solution would definitely unblock @jd-carroll Looking at the bigger picture though, we should see if there's a way around this without requiring the user to do either. I don't think it's intuitive for users to know that they need to pass in a security group if their cluster is created in a separate stack. Nor should they be required to create a load balancer if the construct should be able to create one for them. |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
I am trying to define a generic
Cluster
stack which would be able to accept any number of service tasks. However, when using two differentstacks
to define theCluster
andService
, CDK fails with a circular reference error.Note: This is using the
ApplicationLoadBalancedEc2Service
from@aws-cdk/aws-ecs-patterns
.Reproduction Steps
I would expect the following to deploy successfully:
Error Log
Fails with: (original bug report contained wrong stack trace)
Environment
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: