Skip to content
This repository was archived by the owner on Jun 22, 2026. It is now read-only.

chore: nlb security group - #5284

Merged
mergify[bot] merged 35 commits into
aws:mainlinefrom
CaptainCarpensir:aiden/nlb-security-group
Sep 18, 2023
Merged

mergify[bot] merged 35 commits into
aws:mainlinefrom
CaptainCarpensir:aiden/nlb-security-group

Conversation

@CaptainCarpensir

@CaptainCarpensir CaptainCarpensir commented Sep 5, 2023 •

Copy link
Copy Markdown
Contributor

Creates a security group for Network Load Balancers!

Changes are for 3 distinct purposes:

  1. Redeploys security group and associated resources to now accept public traffic to NLB with specified ports/protocol when using UDP protocol
    • Moves security group from network configuration to NLB
    • Changes name of resources which need to be redeployed
  2. Changes wkld custom domain lambda to no longer assume that the hosted zone and DNS associated with an alias never change
  3. Marks for removal the API call to retrieve CIDR blocks for NLB security group, as the NLB is now public facing, and should accept all public traffic on the correct ports

The next step to completing this feature is to make changes to the manifest package to correctly configure and validate the usage of UDP for the NLB.

First step in #4767

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.

@CaptainCarpensir
CaptainCarpensir requested a review from a team as a code owner September 5, 2023 22:55
@CaptainCarpensir
CaptainCarpensir requested review from iamhopaul123 and removed request for a team September 5, 2023 22:55
@github-actions

github-actions Bot commented Sep 5, 2023 •

Copy link
Copy Markdown

🍕 Here are the new binary sizes!

Name New size (kiB) size (kiB) Delta (%)
macOS (amd) 51820 51740 +0.15
macOS (arm) 52668 52596 +0.14
linux (amd) 45576 45496 +0.18
linux (arm) 44868 44804 +0.14
windows (amd) 43040 42968 +0.17

@codecov-commenter

codecov-commenter commented Sep 5, 2023 •

Copy link
Copy Markdown

Codecov Report

Patch coverage: 60.94% and project coverage change: -0.08% ⚠️

Comparison is base (fb09ff2) 69.84% compared to head (27319db) 69.76%.
Report is 34 commits behind head on mainline.

Additional details and impacted files
@@             Coverage Diff              @@
##           mainline    #5284      +/-   ##
============================================
- Coverage     69.84%   69.76%   -0.08%     
============================================
  Files           296      296              
  Lines         44307    44592     +285     
  Branches        286      287       +1     
============================================
+ Hits          30946    31111     +165     
- Misses        11864    11973     +109     
- Partials       1497     1508      +11     
Files Changed Coverage Δ
internal/pkg/cli/deploy/lbws.go 57.57% <0.00%> (-0.30%) ⬇️
internal/pkg/cli/flag.go 90.47% <ø> (ø)
internal/pkg/cli/init.go 23.22% <ø> (-0.91%) ⬇️
...rnal/pkg/deploy/cloudformation/stack/lb_web_svc.go 82.55% <ø> (ø)
internal/pkg/docker/dockerengine/dockerengine.go 80.14% <0.00%> (-2.48%) ⬇️
internal/pkg/template/workload.go 52.47% <ø> (+1.26%) ⬆️
internal/pkg/cli/deploy.go 47.60% <56.61%> (+11.52%) ⬆️
internal/pkg/cli/run_local.go 74.04% <58.62%> (ø)
cf-custom-resources/lib/wkld-custom-domain.js 91.62% <87.50%> (-0.38%) ⬇️
internal/pkg/term/selector/selector.go 79.44% <93.33%> (+0.09%) ⬆️
... and 6 more

... and 25 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@CaptainCarpensir
CaptainCarpensir marked this pull request as draft September 6, 2023 18:22
@CaptainCarpensir
CaptainCarpensir marked this pull request as ready for review September 6, 2023 22:09

@Lou1415926 Lou1415926 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

niceeee

@CaptainCarpensir
CaptainCarpensir marked this pull request as draft September 11, 2023 21:13
@CaptainCarpensir
CaptainCarpensir marked this pull request as ready for review September 13, 2023 21:21

@huanjani huanjani left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

😍 Looks good to me!

@huanjani huanjani added the do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. label Sep 15, 2023
IpProtocol: -1
SourceSecurityGroupId: !GetAtt NetworkLoadBalancerSecurityGroup.GroupId
{{- else}}
NLBSecurityGroup:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we not drop this now? and just do the same thing we do with EnvironmentSecurityGroupIngressFromNetworkLoadBalancerSecurityGroup?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think so, because the only reason we can use the EnvironmentSecurityGroupIngressFromNetworkLoadBalancerSecurityGroup is that it accepts traffic from the newly created security group, but that one can only exist when it can be created with the NLB.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Adding a bit more detail here!

So we are promoting to V2 for users that enable UDP, and staying in V1 for users with existing NLB and has not enabled UDP, for 2 versions. After 2 versions, the second group of users will promote to V2 as well.

Using EnvironmentSecurityGroupIngressFromNetworkLoadBalancerSecurityGroup is only possible for V2, i.e. group 1 users, which is exactly what the {{if}} statement represents. The group 2 is what the {{else}} statement corresponds to.

@CaptainCarpensir CaptainCarpensir removed the do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. label Sep 18, 2023
@mergify
mergify Bot merged commit de35010 into aws:mainline Sep 18, 2023

@Lou1415926 Lou1415926 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry I'm late!!! I don't have any major comment - just a few super minor nits! Great job!

return nil, fmt.Errorf("new app describer for application %s: %w", in.App.Name, err)
}

// TODO(Aiden): remove when NetworkLoadBalancer is forcibly updated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❤️ !

additional_listeners:
- port: 8081/tcp
- port: 8080/tcp
- port: 8081/udp

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yay good thinking! This way we are also making sure that svc-nlb-dev.stack.yml, which does not have udp, is not being changed in this release

IpProtocol: -1
SourceSecurityGroupId: !GetAtt NetworkLoadBalancerSecurityGroup.GroupId
{{- else}}
NLBSecurityGroup:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Adding a bit more detail here!

So we are promoting to V2 for users that enable UDP, and staying in V1 for users with existing NLB and has not enabled UDP, for 2 versions. After 2 versions, the second group of users will promote to V2 as well.

Using EnvironmentSecurityGroupIngressFromNetworkLoadBalancerSecurityGroup is only possible for V2, i.e. group 1 users, which is exactly what the {{if}} statement represents. The group 2 is what the {{else}} statement corresponds to.

mergify Bot pushed a commit that referenced this pull request Sep 20, 2023
Addresses feedback on #5303 and #5284 from after they were merged



By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
@CaptainCarpensir
CaptainCarpensir deleted the aiden/nlb-security-group branch October 9, 2023 16:12
KollaAdithya pushed a commit to KollaAdithya/copilot-cli that referenced this pull request Oct 18, 2023
#### Creates a security group for Network Load Balancers!

Changes are for 3 distinct purposes:
1. Redeploys security group and associated resources to now accept public traffic to NLB with specified ports/protocol when using UDP protocol
    - Moves security group from network configuration to NLB
    - Changes name of resources which need to be redeployed
4. Changes wkld custom domain lambda to no longer assume that the hosted zone and DNS associated with an alias never change
5. Marks for removal the API call to retrieve CIDR blocks for NLB security group, as the NLB is now public facing, and should accept all public traffic on the correct ports

The next step to completing this feature is to make changes to the manifest package to correctly configure and validate the usage of UDP for the NLB.


First step in aws#4767 

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
KollaAdithya pushed a commit to KollaAdithya/copilot-cli that referenced this pull request Oct 18, 2023
Addresses feedback on aws#5303 and aws#5284 from after they were merged



By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants