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

feat(ecs): add external network modes to ExternalTaskDefinition and TaskDefinition #17762

Merged
merged 10 commits into from
Jun 14, 2022

Conversation

beezly
Copy link
Contributor

@beezly beezly commented Nov 29, 2021

Adds support for Host and None network modes when creating Task Definitions with External compatibility.

See https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-anywhere.html


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Nov 29, 2021

@mergify
Copy link
Contributor

mergify bot commented Nov 29, 2021

Title does not follow the guidelines of Conventional Commits. Please adjust title before merge.

@beezly beezly changed the title Add external network modes to ExternalTaskDefinition and TaskDefinition feat(ecs): Add external network modes to ExternalTaskDefinition and TaskDefinition Nov 29, 2021
@github-actions github-actions bot added the @aws-cdk/aws-ecs Related to Amazon Elastic Container label Nov 29, 2021
@pahud
Copy link
Contributor

pahud commented Dec 1, 2021

Hey @neilkuan @clarencetw @dwchiang @kimisme9386 can you take a first look?

@beezly
Copy link
Contributor Author

beezly commented Dec 7, 2021

@pahud is anything else needed for this - I also have a branch building against the v2 code. https://github.com/beezly/aws-cdk/tree/v2_network_modes

Copy link
Contributor

@madeline-k madeline-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this PR, @beezly! Just a few minor comments, and then it is ready to go.

*
* With ECS Anywhere, supported modes are bridge, host and none.
*
* @default - NetworkMode.Bridge
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @default - NetworkMode.Bridge
* @default NetworkMode.BRIDGE

Comment on lines 73 to 77
/**
* The networking mode to use for the containers in the task.
*/
public readonly networkMode: NetworkMode;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This public property is not used anywhere, so let's not add it until there is a requirement for it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this already exists in the base class, TaskDefinition. It should still be removed from here.

});

this.networkMode = props.networkMode ?? NetworkMode.BRIDGE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.networkMode = props.networkMode ?? NetworkMode.BRIDGE;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already done by passing in props.networkMode ?? NetworkMode.BRIDGE to the super constructor.

@@ -49,7 +50,7 @@ describe('external task definition', () => {
],
},
Family: 'ecs-tasks',
NetworkMode: ecs.NetworkMode.BRIDGE,
NetworkMode: ecs.NetworkMode.HOST,
Copy link
Contributor

@madeline-k madeline-k Mar 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's test on the actual string value of the enum, so if someone changes the value of NetworkMode.HOST in the future, this test will catch it.

Suggested change
NetworkMode: ecs.NetworkMode.HOST,
NetworkMode: 'host',

madeline-k
madeline-k previously approved these changes Mar 24, 2022
Copy link
Contributor

@madeline-k madeline-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving

@beezly
Copy link
Contributor Author

beezly commented May 17, 2022

@madeline-k looks like this didn't merge but I'm not sure why. Are you able to give me a hint?

@TheRealAmazonKendra TheRealAmazonKendra added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Jun 13, 2022
@TheRealAmazonKendra TheRealAmazonKendra changed the base branch from v1-main to main June 13, 2022 21:07
@TheRealAmazonKendra TheRealAmazonKendra changed the title feat(ecs): Add external network modes to ExternalTaskDefinition and TaskDefinition feat(ecs): add external network modes to ExternalTaskDefinition and TaskDefinition Jun 13, 2022
@github-actions github-actions bot added the p2 label Jun 13, 2022
@mergify
Copy link
Contributor

mergify bot commented Jun 13, 2022

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: aa402dc
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit dd90feb into aws:main Jun 14, 2022
@mergify
Copy link
Contributor

mergify bot commented Jun 14, 2022

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@beezly beezly deleted the network_modes branch June 28, 2022 10:46
daschaa pushed a commit to daschaa/aws-cdk that referenced this pull request Jul 9, 2022
…askDefinition (aws#17762)

Adds support for Host and None network modes when creating Task Definitions with External compatibility.

See https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-anywhere.html  

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
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 p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants