set_security_groups
async
¶
set_security_groups(
*,
config_overrides: Optional[AsyncElasticLoadBalancingv2ClientConfig] = None,
load_balancer_arn: Optional[LoadBalancerArn] = None,
security_groups: Optional[SecurityGroups] = None,
enforce_security_group_inbound_rules_on_private_link_traffic: Optional[
EnforceSecurityGroupInboundRulesOnPrivateLinkTrafficEnum
] = None,
) -> SetSecurityGroupsOutput
Associates the specified security groups with the specified Application Load Balancer or Network Load Balancer. The specified security groups override the previously associated security groups.
You can't perform this operation on a Network Load Balancer unless you specified a security group for the load balancer when you created it.
You can't associate a security group with a Gateway Load Balancer.
Parameters:
-
load_balancer_arn(Optional[LoadBalancerArn], default:None) –The Amazon Resource Name (ARN) of the load balancer.
-
security_groups(Optional[SecurityGroups], default:None) –The IDs of the security groups.
-
enforce_security_group_inbound_rules_on_private_link_traffic(Optional[EnforceSecurityGroupInboundRulesOnPrivateLinkTrafficEnum], default:None) –Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through Amazon Web Services PrivateLink. Applies only if the load balancer has an associated security group. The default is
on.
Raises:
-
InvalidConfigurationRequestException–The requested configuration is not valid.
-
InvalidSecurityGroupException–The specified security group does not exist.
-
LoadBalancerNotFoundException–The specified load balancer does not exist.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To associate a security group with a load balancer This example associates the specified security group with the specified load balancer.
>>> await client.set_security_groups(load_balancer_arn='arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188', security_groups=['sg-5943793c'])
Source code in docs_src/capo_elastic_load_balancing_v2/_services/async_elastic_load_balancingv2.py
4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 | |