updateLoadBalancerAttribute method
Updates the specified attribute for a load balancer. You can only update one attribute at a time.
The update load balancer attribute operation supports
tag-based access control via resource tags applied to the resource
identified by load balancer name. For more information, see
the Amazon
Lightsail Developer Guide.
May throw AccessDeniedException.
May throw AccountSetupInProgressException.
May throw InvalidInputException.
May throw NotFoundException.
May throw OperationFailureException.
May throw RegionSetupInProgressException.
May throw ServiceException.
May throw UnauthenticatedException.
Parameter attributeName :
The name of the attribute you want to update.
Parameter attributeValue :
The value that you want to specify for the attribute name.
The following values are supported depending on what you specify for the
attributeName request parameter:
-
If you specify
HealthCheckPathfor theattributeNamerequest parameter, then theattributeValuerequest parameter must be the path to ping on the target (for example,/weather/us/wa/seattle). -
If you specify
SessionStickinessEnabledfor theattributeNamerequest parameter, then theattributeValuerequest parameter must betrueto activate session stickiness orfalseto deactivate session stickiness. -
If you specify
SessionStickiness_LB_CookieDurationSecondsfor theattributeNamerequest parameter, then theattributeValuerequest parameter must be an interger that represents the cookie duration in seconds. -
If you specify
HttpsRedirectionEnabledfor theattributeNamerequest parameter, then theattributeValuerequest parameter must betrueto activate HTTP to HTTPS redirection orfalseto deactivate HTTP to HTTPS redirection. -
If you specify
TlsPolicyNamefor theattributeNamerequest parameter, then theattributeValuerequest parameter must be the name of the TLS policy.Use the GetLoadBalancerTlsPolicies action to get a list of TLS policy names that you can specify.
Parameter loadBalancerName :
The name of the load balancer that you want to modify
(my-load-balancer.
Implementation
Future<UpdateLoadBalancerAttributeResult> updateLoadBalancerAttribute({
required LoadBalancerAttributeName attributeName,
required String attributeValue,
required String loadBalancerName,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Lightsail_20161128.UpdateLoadBalancerAttribute'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'attributeName': attributeName.value,
'attributeValue': attributeValue,
'loadBalancerName': loadBalancerName,
},
);
return UpdateLoadBalancerAttributeResult.fromJson(jsonResponse.body);
}