createAppCookieStickinessPolicy method
Generates a stickiness policy with sticky session lifetimes that follow that of an application-generated cookie. This policy can be associated only with HTTP/HTTPS listeners.
This policy is similar to the policy created by
CreateLBCookieStickinessPolicy, except that the lifetime of the
special Elastic Load Balancing cookie, AWSELB
, follows the
lifetime of the application-generated cookie specified in the policy
configuration. The load balancer only inserts a new stickiness cookie when
the application response includes a new application cookie.
If the application cookie is explicitly removed or expires, the session stops being sticky until a new application cookie is issued.
For more information, see Application-Controlled Session Stickiness in the Classic Load Balancers Guide.
May throw AccessPointNotFoundException. May throw DuplicatePolicyNameException. May throw TooManyPoliciesException. May throw InvalidConfigurationRequestException.
Parameter cookieName
:
The name of the application cookie used for stickiness.
Parameter loadBalancerName
:
The name of the load balancer.
Parameter policyName
:
The name of the policy being created. Policy names must consist of
alphanumeric characters and dashes (-). This name must be unique within
the set of policies for this load balancer.
Implementation
Future<void> createAppCookieStickinessPolicy({
required String cookieName,
required String loadBalancerName,
required String policyName,
}) async {
ArgumentError.checkNotNull(cookieName, 'cookieName');
ArgumentError.checkNotNull(loadBalancerName, 'loadBalancerName');
ArgumentError.checkNotNull(policyName, 'policyName');
final $request = <String, dynamic>{};
$request['CookieName'] = cookieName;
$request['LoadBalancerName'] = loadBalancerName;
$request['PolicyName'] = policyName;
await _protocol.send(
$request,
action: 'CreateAppCookieStickinessPolicy',
version: '2012-06-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['CreateAppCookieStickinessPolicyInput'],
shapes: shapes,
resultWrapper: 'CreateAppCookieStickinessPolicyResult',
);
}