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

aws-ecs: ECS Anywhere for Windows not supported due to restriction on network mode #19922

Closed
grollat opened this issue Apr 14, 2022 · 3 comments
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container bug This issue is a bug. p1

Comments

@grollat
Copy link

grollat commented Apr 14, 2022

Describe the bug

in the following file
https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-ecs/lib/base/task-definition.ts
the following check was implemented too support ECS Anywhere:
throw new Error(External tasks can only have Bridge network mode, got: ${this.networkMode});
Since ECS-Anywhere for windows was release a few weeks ago we should lift this restriction. the documentation (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-anywhere.html) states now:
"Tasks that run on external instances must use the bridge, host, or none network modes. The awsvpc network mode isn't supported."
this issue is blocking the use of CDK with ECS for windows.

Expected Behavior

all network modes supported in the doc shouold be supported in the code:
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-anywhere.html

Current Behavior

only bridge network mode is supported which prevent creation of external task def for windows OS

Reproduction Steps

   const adminTaskDefinitionWindows = new ecs.TaskDefinition(this, 'REPAdminTaskWindows', {
      executionRole: taskExecRole,
      compatibility: ecs.Compatibility.EXTERNAL,
      networkMode: ecs.NetworkMode.NONE,
      placementConstraints: [ecs.PlacementConstraint.memberOf("attribute:ecs.os-type == windows")]
    });

Possible Solution

change the network mode check (or remove it completely and let the service API be the master when it comes to these checks which would avoid having too keep updating the code.

Note that ExternalTaskProp struct also should support adding the network mode as an option.

Additional Information/Context

No response

CDK CLI Version

2.9.0

Framework Version

No response

Node.js Version

v14.15.4

OS

MACOSX

Language

Typescript

Language Version

No response

Other information

No response

@grollat grollat added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 14, 2022
@github-actions github-actions bot added the @aws-cdk/aws-ecs Related to Amazon Elastic Container label Apr 14, 2022
grollat added a commit to grollat/aws-cdk that referenced this issue Apr 14, 2022
quick fix for bug: aws#19922 
A longer term solution should be put together that includes updating the ExternalTaskProp structure to support network modes now that ECS-A for windows allows more than bridge
@ryparker ryparker added the p1 label Apr 26, 2022
@peterwoodworth peterwoodworth removed the needs-triage This issue or PR still needs to be triaged. label Apr 27, 2022
@madeline-k madeline-k removed their assignment May 16, 2022
@pallymore
Copy link
Member

this has been fixed.

@pahud
Copy link
Contributor

pahud commented May 19, 2023

closing as it's been fixed

@pahud pahud closed this as completed May 19, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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. p1
Projects
None yet
Development

No branches or pull requests

6 participants