-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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): fromClusterAttributes requires VPC #12468
Comments
We are having the same issue in a different context. In cloudformation, creating a fargate serivice only requires |
I'm having a similar issue. I've searched all afternoon to find a way to reuse an ECS cluster in another CDK App than the one where the cluster was created. Referencing an existing ECS cluster requires (among other things):
cluster = ecs.Cluster(self, "ECSCluster", cluster_name='my-cluster', vpc=self.vpc)
security_group_ids = [sg.security_group_id for sg in cluster.connections.security_groups]
CfnOutput(self, "SGExport", value=Fn.join(',', security_group_ids), export_name='sg-ids') Because it gives me this error: Apparently |
Same applies to EKS Cluster.fromClusterAttributes(). |
I have a feeling they are making some really strange design decisions with cdk :( Not only do they go against expectations and logic (a unique ID should be enough to give you the object, such as the cluster), but also against what we are used to with the cli and sdk... |
Any update on this? Still facing this problem today. My situation is similar to @dandydev 's; I'm trying to reuse an ECS cluster in another CDK app. |
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'm trying to fetch an ECS cluster based on its name, but security groups (mentioned here) and VPC (at least) are required.
Reproduction Steps
What did you expect to happen?
I would expect
fromClusterAttributes
to have the same behaviour asaws ecs describe-clusters <clusterName>
. The API clearly doesn't require you to provide the VPC (or security groups), so why does this?What actually happened?
Exception in thread "main" java.lang.NullPointerException: vpc is required
Environment
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: