ModifyLoadBalancerAttributes - Elastic Load Balancing

ModifyLoadBalancerAttributes

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.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

Attributes.member.N

The load balancer attributes.

Type: Array of LoadBalancerAttribute objects

Array Members: Maximum number of 20 items.

Required: Yes

LoadBalancerArn

The Amazon Resource Name (ARN) of the load balancer.

Type: String

Required: Yes

Response Elements

The following element is returned by the service.

Attributes.member.N

Information about the load balancer attributes.

Type: Array of LoadBalancerAttribute objects

Array Members: Maximum number of 20 items.

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidConfigurationRequest

The requested configuration is not valid.

HTTP Status Code: 400

LoadBalancerNotFound

The specified load balancer does not exist.

HTTP Status Code: 400

Examples

Enable deletion protection

This example enables deletion protection for the specified load balancer.

Sample Request

https://elasticloadbalancing.amazonaws.com/?Action=ModifyLoadBalancerAttributes &LoadBalancerArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 &Attributes.member.1.Key=deletion_protection.enabled &Attributes.member.1.Value=true &Version=2015-12-01 &AUTHPARAMS

Sample Response

<ModifyLoadBalancerAttributesResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/"> <ModifyLoadBalancerAttributesResult> <Attributes> <member> <Value>true</Value> <Key>deletion_protection.enabled</Key> </member> <member> <Value>false</Value> <Key>access_logs.s3.enabled</Key> </member> <member> <Value>60</Value> <Key>idle_timeout.timeout_seconds</Key> </member> <member> <Value /> <Key>access_logs.s3.prefix</Key> </member> <member> <Value /> <Key>access_logs.s3.bucket</Key> </member> </Attributes> </ModifyLoadBalancerAttributesResult> <ResponseMetadata> <RequestId>b2066529-f42c-11e5-b543-9f2c3fbb9bee</RequestId> </ResponseMetadata> </ModifyLoadBalancerAttributesResponse>

Change the idle timeout

This example changes the idle timeout value for the specified Application Load Balancer.

Sample Request

https://elasticloadbalancing.amazonaws.com/?Action=ModifyLoadBalancerAttributes &LoadBalancerArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 &Attributes.member.1.Key=idle_timeout.timeout_seconds &Attributes.member.1.Value=30 &Version=2015-12-01 &AUTHPARAMS

Sample Response

<ModifyLoadBalancerAttributesResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/"> <ModifyLoadBalancerAttributesResult> <Attributes> <member> <Value>30</Value> <Key>idle_timeout.timeout_seconds</Key> </member> <member> <Value>false</Value> <Key>access_logs.s3.enabled</Key> </member> <member> <Value /> <Key>access_logs.s3.prefix</Key> </member> <member> <Value>false</Value> <Key>deletion_protection.enabled</Key> </member> <member> <Value /> <Key>access_logs.s3.bucket</Key> </member> </Attributes> </ModifyLoadBalancerAttributesResult> <ResponseMetadata> <RequestId>d3f6e6dc-f42c-11e5-b5ae-8bfaf16614ac</RequestId> </ResponseMetadata> </ModifyLoadBalancerAttributesResponse>

Enable access logs

This example enables access logs for the specified Application Load Balancer. The S3 bucket must exist in the same Region as the load balancer and must have a bucket policy that grants Elastic Load Balancing permissions to write to the bucket.

Sample Request

https://elasticloadbalancing.amazonaws.com/?Action=ModifyLoadBalancerAttributes &LoadBalancerArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 &Attributes.member.1.Key=access_logs.s3.enabled &Attributes.member.1.Value=true &Attributes.member.2.Key=access_logs.s3.bucket &Attributes.member.2.Value=my-loadbalancer-logs &Attributes.member.3.Key=access_logs.s3.prefix &Attributes.member.3.Value=myapp &Version=2015-12-01 &AUTHPARAMS

Sample Response

<ModifyLoadBalancerAttributesResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/"> <ModifyLoadBalancerAttributesResult> <Attributes> <member> <Value>true</Value> <Key>access_logs.s3.enabled</Key> </member> <member> <Value>my-loadbalancer-logs</Value> <Key>access_logs.s3.bucket</Key> </member> <member> <Value>myapp</Value> <Key>access_logs.s3.prefix</Key> </member> <member> <Value>60</Value> <Key>idle_timeout.timeout_seconds</Key> </member> <member> <Value>false</Value> <Key>deletion_protection.enabled</Key> </member> </Attributes> </ModifyLoadBalancerAttributesResult> <ResponseMetadata> <RequestId>095cb76d-f52e-11e5-bb98-57195a6eb84a</RequestId> </ResponseMetadata> </ModifyLoadBalancerAttributesResponse>

Enable connection logs.

This example enables connection logs, setting the specified S3 bucket and prefix location.

Sample Request

https://elasticloadbalancing.amazonaws.com/?Action=ModifyLoadBalancerAttributes &LoadBalancerArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 &Attributes.member.1.Key=connection_logs.s3.enabled &Attributes.member.1.Value=true &Attributes.member.2.Key=connection_logs.s3.bucket &Attributes.member.2.Value=my-loadbalancer-connection-logs &Attributes.member.3.Key=connection_logs.s3.prefix &Attributes.member.3.Value=myapp-connections &Version=2015-12-01 &AUTHPARAMS

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: