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-patterns): add missing NLB task image options #30775

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nmussy
Copy link
Contributor

@nmussy nmussy commented Jul 7, 2024

Issue # (if applicable)

Closes #30760.

Reason for this change

The ECS patterns L3 allows to create a load balanced Fargate or EC2 task, and to customize their run options. ALB task patterns implemented additional properties that NLB didn't.

Description of changes

  • Add command, entryPoint props to NetworkLoadBalancedFargateService and NetworkLoadBalancedEc2Service
  • Add healthCheck prop to NetworkLoadBalancedFargateService
    • I assume there's a good reason why, but I can't find out why healthChecks are only exposed for Fargate targets

Description of how you validated changes

No unit or integ were added/updated

Checklist


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

@aws-cdk-automation aws-cdk-automation requested a review from a team July 7, 2024 08:54
@github-actions github-actions bot added feature-request A feature should be added or improved. p2 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK labels Jul 7, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@nmussy
Copy link
Contributor Author

nmussy commented Jul 7, 2024

Exemption Request: The current coverage of ECS pattern tasks isn't great, both for ALB and NLB. I don't think it's pertinent to add a couple of tests for these props, it would be a lot more pertinent to redo the entire classes

Regarding the README, I don't think these props need to be listed

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Jul 7, 2024
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 7, 2024
@godwingrs22 godwingrs22 self-requested a review January 7, 2025 23:45
Copy link
Member

@godwingrs22 godwingrs22 left a comment

Choose a reason for hiding this comment

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

Thanks @nmussy for the contribution. It would be good to have unit tests and integ test for these properties similar to ALB EC2 and Fargate services. It is ok not to update README for these props, but would recommend to have the testcases.

Comment on lines +89 to +95
healthCheck: props.healthCheck,
logging: logDriver,
environment: taskImageOptions.environment,
secrets: taskImageOptions.secrets,
dockerLabels: taskImageOptions.dockerLabels,
command: taskImageOptions.command,
entryPoint: taskImageOptions.entryPoint,
Copy link
Member

Choose a reason for hiding this comment

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

I see similar properties available in ApplicationLoadBalancedFargateService and since we are adding the same to NetworkLoadBalancedFargateService, I would recommend we have some unit test that covers these properties. We could have some testcases similar to these in ApplicationLoadBalancedFargateService.

Comment on lines +129 to +130
command: taskImageOptions.command,
entryPoint: taskImageOptions.entryPoint,
Copy link
Member

Choose a reason for hiding this comment

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

Similarly we should have some unit tests for these commands in NetworkLoadBalancedEc2Service. We have some similar test cases for ApplicationLoadBalancedEc2Service.

Copy link
Member

Choose a reason for hiding this comment

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

Also we need integ test that can test these properties for NetworkLoadBalancedEc2Service and NetworkLoadBalancedFargateService. We have similar for ALB here for EC2 and Fargate

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jan 8, 2025
@xazhao xazhao removed the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Jan 13, 2025
@godwingrs22 godwingrs22 self-assigned this Jan 14, 2025
@nmussy
Copy link
Contributor Author

nmussy commented Jan 14, 2025

@godwingrs22 Seems like coverage for ecs-patterns was improved since this PR was originally opened a few months ago. I'll update it 👍

@aws-cdk-automation
Copy link
Collaborator

The pull request linter fails with the following errors:

❌ Features must contain a change to a README file.
❌ Features must contain a change to an integration test file and the resulting snapshot.

PRs must pass status checks before we can provide a meaningful review.

If you would like to request an exemption from the status checks or clarification on feedback, please leave a comment on this PR containing Exemption Request and/or Clarification Request.

✅ A exemption request has been requested. Please wait for a maintainer's review.

Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.40%. Comparing base (5a830a0) to head (291a461).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #30775   +/-   ##
=======================================
  Coverage   81.40%   81.40%           
=======================================
  Files         223      223           
  Lines       13727    13727           
  Branches     2411     2411           
=======================================
  Hits        11175    11175           
  Misses       2274     2274           
  Partials      278      278           
Flag Coverage Δ
suite.unit 81.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk 80.74% <ø> (ø)
packages/aws-cdk-lib/core 82.10% <ø> (ø)

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distinguished-contributor [Pilot] contributed 50+ PRs to the CDK feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

command parameter for NetworkLoadBalancedTaskImageOptions
4 participants