-
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
fix(ecs): nat network mode for windows tasks #4317
Conversation
Add NAT network mode to support Windows container networking. This is the only network mode supported by Windows. See https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows_task_IAM_roles.html for additional details. fixes aws#4272
Thanks so much for taking the time to contribute to the AWS CDK ❤️ We will shortly assign someone to review this pull request and help get it
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@SoManyHs I'm afraild I need you help here - here is the error from the build:
Just successfully re-run ./build.sh locally without any errors. I'm puzzled because I didn't change ec2 module at all. |
} | ||
|
||
private renderNetworkMode(networkMode: NetworkMode): string | undefined { | ||
// 'NAT' is the only supported network mode for Windows containers, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is also explained in the ENUM def, I think you can combine those lines of comment into the ENUM one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, makes sense. Thanks!
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@@ -428,6 +428,14 @@ export class TaskDefinition extends TaskDefinitionBase { | |||
private findContainer(containerName: string): ContainerDefinition | undefined { | |||
return this.containers.find(c => c.containerName === containerName); | |||
} | |||
|
|||
private isEphemeralPortMappingSupported(networkMode: NetworkMode): boolean { | |||
return networkMode === NetworkMode.BRIDGE || networkMode === NetworkMode.NAT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: personally, I'd prefer these conditions in the if statement itself, just to allow for ease of debugging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, will address that
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
…k into kolomied/nat-networkmode
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship it! @kolomied, thanks for taking the time to fix this issue!
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request is now being automatically merged. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Add NAT network mode to support Windows container networking.
This is the only network mode supported by Windows.
See https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows_task_IAM_roles.html for additional details.
fixes #4272
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license