Skip to content
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

Can't attach CfnAutoScalingGroup to an ECS Cluster #8005

Closed
2 tasks
Cloudrage opened this issue May 15, 2020 · 3 comments
Closed
2 tasks

Can't attach CfnAutoScalingGroup to an ECS Cluster #8005

Cloudrage opened this issue May 15, 2020 · 3 comments
Labels
@aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling @aws-cdk/aws-ecs Related to Amazon Elastic Container closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/large Large work item – several weeks of effort feature-request A feature should be added or improved. needs-reproduction This issue needs reproduction. p2

Comments

@Cloudrage
Copy link

Cloudrage commented May 15, 2020

Use Case

I've created an ASG via CfnAutoScalingGroup for my EC2 ECS hosts, why ? :

  • AutoScalingGroup Construct do not provide launch-templates
  • aws-autoscaling.BlockDevice do not provide use of CMK
  • aws-ecs.AddCapacityOptions don't provide UserData

So, I've created all my needed resources :

  • ASG (CfnAutoScalingGroup, autoscaling.CfnScheduledAction)
  • Launch-template (CfnLaunchTemplate)
  • UserData (with Agent + custom configuration; CloudWatch for example)
  • Secrets (secretsmanager.Secret)
  • KeyPair (CustomResource.AwsCustomResource)
  • CMK (kms.Key)
  • SSM (ssm.StringParameter)
  • SGR (SecurityGroup)
  • IAM (iam.ManagedPolicy, iam.Role, iam.CfnInstanceProfile)
  • LogGroup (logs.LogGroup)
  • EFS (efs.FileSystem)
  • Cloudwatch (logs.MetricFilter, cloudwatch.Alarm, cloudwatch.Metric, CloudwatchActions.SnsAction)
  • ACM (certificatemanager.Certificate)
  • ALB (elbv2.ApplicationLoadBalancer, elbv2.ApplicationTargetGroup)
  • ECS (ecs.Cluster, ecs.TaskDefinition, ecs.ContainerDefinition, ecs.Ec2Service)

After all that resources creation, the last to be created is the ecs.Ec2Service, but unfortunatly, I have this error :
Cluster for this service needs Ec2 capacity. Call addXxxCapacity() on the cluster.

Of course, my Cluster have my EC2 container instance up & available.

Proposed Solution

You already have feature requests opened (some from me) for :

  • launch-template
  • BlockDevice (CMK)
  • EFS (CMK from another account)

It'll also be interesting to be able to have :
UserData prop in aws-ecs.AddCapacityOptions.

Without these updates, I'm blocked.

And be able to attach an ASG to an ECS Service by Ref (his name in our case) ?

Other

But now, how after all that lines of Typescript code... What can I do to have my ECS Service created ?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@Cloudrage Cloudrage added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels May 15, 2020
@SomayaB SomayaB added @aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling @aws-cdk/aws-ecs Related to Amazon Elastic Container labels May 18, 2020
@piradeepk piradeepk added guidance Question that needs advice or information. needs-reproduction This issue needs reproduction. and removed needs-triage This issue or PR still needs to be triaged. labels Jun 1, 2020
@SoManyHs
Copy link
Contributor

Related #1711

@SoManyHs SoManyHs added the effort/large Large work item – several weeks of effort label Jun 15, 2020
@kellertk kellertk removed the guidance Question that needs advice or information. label Sep 10, 2020
@SoManyHs
Copy link
Contributor

This may be addressed by #14386

@github-actions
Copy link

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.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling @aws-cdk/aws-ecs Related to Amazon Elastic Container closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/large Large work item – several weeks of effort feature-request A feature should be added or improved. needs-reproduction This issue needs reproduction. p2
Projects
None yet
Development

No branches or pull requests

7 participants