aws elbv2 set-security-groups
Associates the specified security groups with the specified Application Load Balancer or Network Load Balancer. AWS CLI reference
1 example 3 options Its page in the AWS CLI reference
Examples
To associate a security group with a load balancer
The following set-security-groups example associates the specified security group with the specified load balancer.
aws elbv2 set-security-groups --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 --security-groups sg-5943793cIdentify--load-balancer-arnThe Amazon Resource Name (ARN) of the load balancer.--security-groupsThe IDs of the security groups.Its output
{
"SecurityGroupIds": [
"sg-5943793c"
]
}For more information, see Security groups for your Application Load Balancer in the Application Load Balancers Guide.
Options
--enforce-security-group-inbound-rules-on-private-link-trafficIndicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through Amazon Web Services PrivateLink.--load-balancer-arnThe Amazon Resource Name (ARN) of the load balancer.--security-groupsThe IDs of the security groups.