modify_load_balancer_attributes
async
¶
modify_load_balancer_attributes(
*,
config_overrides: Optional[AsyncElasticLoadBalancingv2ClientConfig] = None,
load_balancer_arn: Optional[LoadBalancerArn] = None,
attributes: Optional[LoadBalancerAttributes] = None,
) -> ModifyLoadBalancerAttributesOutput
Modifies the specified attributes of the specified Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.
If any of the specified attributes can't be modified as requested, the call fails. Any existing attributes that you do not modify retain their current values.
Parameters:
-
load_balancer_arn(Optional[LoadBalancerArn], default:None) –The Amazon Resource Name (ARN) of the load balancer.
-
attributes(Optional[LoadBalancerAttributes], default:None) –The load balancer attributes.
Raises:
-
InvalidConfigurationRequestException–The requested configuration is not valid.
-
LoadBalancerNotFoundException–The specified load balancer does not exist.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To enable deletion protection This example enables deletion protection for the specified load balancer.
>>> await client.modify_load_balancer_attributes(load_balancer_arn='arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188', attributes=[{'Key': 'deletion_protection.enabled', 'Value': 'true'}])
To change the idle timeout
This example changes the idle timeout value for the specified load balancer.
>>> await client.modify_load_balancer_attributes(load_balancer_arn='arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188', attributes=[{'Key': 'idle_timeout.timeout_seconds', 'Value': '30'}])
To enable access logs
This example enables access logs for the specified load balancer. Note that the S3 bucket must exist in the same region as the load balancer and must have a policy attached that grants access to the Elastic Load Balancing service.
>>> await client.modify_load_balancer_attributes(load_balancer_arn='arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188', attributes=[{'Key': 'access_logs.s3.enabled', 'Value': 'true'}, {'Key': 'access_logs.s3.bucket', 'Value': 'my-loadbalancer-logs'}, {'Key': 'access_logs.s3.prefix', 'Value': 'myapp'}])
Source code in docs_src/capo_elastic_load_balancing_v2/_services/async_elastic_load_balancingv2.py
3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 | |