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

ecs.ExternalService: daemon and placementConstraints not implemented #31204

Open
1 task
mattstam opened this issue Aug 23, 2024 · 2 comments
Open
1 task

ecs.ExternalService: daemon and placementConstraints not implemented #31204

mattstam opened this issue Aug 23, 2024 · 2 comments
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Comments

@mattstam
Copy link

mattstam commented Aug 23, 2024

Describe the bug

Extension of this: aws/containers-roadmap#2395

I would like to enable daemon-type scheduling for services running on External instances through ECS-Anywhere. If the daemon boolean option is not available, then a workaround would simply to be to do use placementConstraints with the DistinctInstance option.

At first, it appeared as if this was unsupported on ECS External services in AWS. However, it appears that placement constraints are already supported in AWS, but just not added to the CDK client - I believe this is the case because if I go edit an existing ecs.ExternalService on the console, I have the option to add placement constraints, but if I use the CDK, it is not an option and gives the following errors when I try on either the External Task Definition or External Service:

- Object literal may only specify known properties, and 'placementConstraints' does not exist in type 'ExternalTaskDefinitionProps'.
- Object literal may only specify known properties, and 'placementConstraints' does not exist in type 'ExternalServiceProps'.

I think a simple fix here is to simply add those fields on either of the ecs.ExternalTaskDefition or ecs.ExternalService types. Longer-term, a daemon option might be nice, but as I understand it, this is basically just syntax sugar around placementConstraints: distinctInstance()?

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

I would expect this:

  return new cdk.aws_ecs.ExternalService(stack, `MyService`, {
    cluster,
    taskDefinition,
    securityGroups,
    daemon: true,
  });

or this:

  return new cdk.aws_ecs.ExternalService(stack, `MyService`, {
    cluster,
    taskDefinition,
    securityGroups,
    placementConstraints: [
      // ...
    ],
  });

to work.

Current Behavior

Those fields are not available.

Reproduction Steps

To reproduce, try the code in the expected behavior

Possible Solution

It's already added to AWS it seems, so in the CDK we just need to add the fields

Additional Information/Context

No response

CDK CLI Version

2.130.0 (build bd6e5ee)

Framework Version

No response

Node.js Version

20

OS

Ubuntu

Language

TypeScript

Language Version

No response

Other information

No response

@mattstam mattstam added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 23, 2024
@github-actions github-actions bot added the @aws-cdk/aws-ecs Related to Amazon Elastic Container label Aug 23, 2024
@mattstam mattstam changed the title ecs.ExternalService: daemon and placementConstraints not implemented ecs.ExternalService: daemon and placementConstraints not implemented Aug 23, 2024
@ashishdhingra ashishdhingra self-assigned this Aug 23, 2024
@ashishdhingra ashishdhingra added p2 investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Aug 23, 2024
@ashishdhingra
Copy link
Contributor

ashishdhingra commented Aug 23, 2024

  • daemon property maps to schedulingStrategy as checked for ec2-service here.
  • placementConstraints are passed here as processed as part of additionalProps in base-service constructor here.

Perhaps we need to add support of these properties in ExternalService.

@ashishdhingra ashishdhingra added effort/medium Medium work item – several days of effort and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Aug 23, 2024
@ashishdhingra ashishdhingra removed their assignment Aug 23, 2024
@mattstam
Copy link
Author

Thanks for the overview @ashishdhingra - based on the proposed implementation steps, do you have an ETA on when this could be added?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container bug This issue is a bug. effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

No branches or pull requests

2 participants