update_load_balancer_attribute
async
¶
update_load_balancer_attribute(
load_balancer_name: ResourceName,
attribute_name: LoadBalancerAttributeName,
attribute_value: StringMax256,
*,
config_overrides: Optional[AsyncLightsailClientConfig] = None,
) -> UpdateLoadBalancerAttributeResult
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.
Parameters:
-
load_balancer_name(ResourceName) –The name of the load balancer that you want to modify (
my-load-balancer. -
attribute_name(LoadBalancerAttributeName) –The name of the attribute you want to update.
-
attribute_value(StringMax256) –The value that you want to specify for the attribute name.
The following values are supported depending on what you specify for the
attributeNamerequest 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.
-
Raises:
-
AccessDeniedException–Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.
-
AccountSetupInProgressException–Lightsail throws this exception when an account is still in the setup in progress state.
-
InvalidInputException–Lightsail throws this exception when user input does not conform to the validation rules of an input field.
Domain and distribution APIs are only available in the N. Virginia (
us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration tous-east-1to create, view, or edit these resources. -
NotFoundException–Lightsail throws this exception when it cannot find a resource.
-
OperationFailureException–Lightsail throws this exception when an operation fails to execute.
-
RegionSetupInProgressException–Lightsail throws this exception when an operation is performed on resources in an opt-in Region that is currently being set up.
-
ServiceException–A general service exception.
-
UnauthenticatedException–Lightsail throws this exception when the user has not been authenticated.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_lightsail/_services/async_lightsail.py
9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 | |