-
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
(aws-elasticloadbalancingv2): (network-load-balancer-supports-security-groups) #26735
(aws-elasticloadbalancingv2): (network-load-balancer-supports-security-groups) #26735
Comments
I can use addPropertyOverride() setting SecurityGroups for now. const lb = new elasticloadbalancingv2.NetworkLoadBalancer(this, 'nyancatNlb', {
vpc,
internetFacing: true,
crossZoneEnabled: true,
});
const ntg80 = lb.addListener('Listener80', { port: 80 });
ntg80.addTargets('svc80', {
port: 80,
targets: [svc],
});
const nlbSg = new ec2.SecurityGroup(this, 'NLBSecurityGroup', { vpc, allowAllOutbound: true });
svc.connections.allowFrom(nlbSg, ec2.Port.tcp(80));
const cfnlb = (lb.node.defaultChild as elasticloadbalancingv2.CfnLoadBalancer );
cfnlb.addPropertyOverride('SecurityGroups', [
nlbSg.securityGroupId,
]); |
Awesome @neilkuan ! This is a huge update from NLB! Can't wait to see it in CDK. |
Hope to see this release soon! |
Looking for this feature too! Thanks for documenting it! |
) Closes #26735. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
For some one who uses CDK python launguage. |
# Summary Implement an `IConnectable` interface to a NetworkLoadBalancer. # Why need this change? AWS CDK has great features for abstraction. `IConnectable` interface is one of this. `IConnectable` simplifies the management of security groups. AWS CDK add support security group to NLB at #27978. However, Currently NLB not implement `IConnectable`, so customers can't use useful interface in AWS CDK. # Example use case ```ts declare const lb: elbv2.NetworkLoadBalancer; declare const asg: autoscaling.AutoScalingGroup; asg.connections.allowFrom(lb, ec2.Port.tcp(8088)); // currently can not ``` Closes #26735 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the feature
https://aws.amazon.com/tw/about-aws/whats-new/2023/08/network-load-balancer-supports-security-groups/
network load balancer supports security groups.
Use Case
Supports create NLB with SG via aws cdk L2.
Proposed Solution
Support securityGroup into NetworkLoadBalancerProps.
Other Information
No response
Acknowledgements
CDK version used
2.91.0
Environment details (OS name and version, etc.)
macOS Ventura 13.4.1
The text was updated successfully, but these errors were encountered: