import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { CreateLBCookieStickinessPolicyInput, CreateLBCookieStickinessPolicyOutput } from "../models/models_0"; /** * @public */ export type { __MetadataBearer }; /** * @public * * The input for {@link CreateLBCookieStickinessPolicyCommand}. */ export interface CreateLBCookieStickinessPolicyCommandInput extends CreateLBCookieStickinessPolicyInput { } /** * @public * * The output of {@link CreateLBCookieStickinessPolicyCommand}. */ export interface CreateLBCookieStickinessPolicyCommandOutput extends CreateLBCookieStickinessPolicyOutput, __MetadataBearer { } declare const CreateLBCookieStickinessPolicyCommand_base: { new (input: CreateLBCookieStickinessPolicyCommandInput): import("@smithy/core/client").CommandImpl; new (input: CreateLBCookieStickinessPolicyCommandInput): import("@smithy/core/client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions; }; /** *

Generates a stickiness policy with sticky session lifetimes controlled by the lifetime of the browser (user-agent) or a specified expiration period. This policy can be associated only with HTTP/HTTPS listeners.

*

When a load balancer implements this policy, the load balancer uses a special cookie to track the instance for each request. When the load balancer receives a request, it first checks to see if this cookie is present in the request. * If so, the load balancer sends the request to the application server specified in the cookie. If not, the load balancer sends the request to a server that is chosen based on the existing load-balancing algorithm.

*

A cookie is inserted into the response for binding subsequent requests from the same user to that server. The validity of the cookie is based on the cookie expiration time, which is specified in the policy configuration.

* *

For more information, see Duration-Based Session Stickiness * in the Classic Load Balancers Guide.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { ElasticLoadBalancingClient, CreateLBCookieStickinessPolicyCommand } from "@aws-sdk/client-elastic-load-balancing"; // ES Modules import * // const { ElasticLoadBalancingClient, CreateLBCookieStickinessPolicyCommand } = require("@aws-sdk/client-elastic-load-balancing"); // CommonJS import * // import type { ElasticLoadBalancingClientConfig } from "@aws-sdk/client-elastic-load-balancing"; * const config = {}; // type is ElasticLoadBalancingClientConfig * const client = new ElasticLoadBalancingClient(config); * const input = { // CreateLBCookieStickinessPolicyInput * LoadBalancerName: "STRING_VALUE", // required * PolicyName: "STRING_VALUE", // required * CookieExpirationPeriod: Number("long"), * }; * const command = new CreateLBCookieStickinessPolicyCommand(input); * const response = await client.send(command); * // {}; * * ``` * * @param CreateLBCookieStickinessPolicyCommandInput - {@link CreateLBCookieStickinessPolicyCommandInput} * @returns {@link CreateLBCookieStickinessPolicyCommandOutput} * @see {@link CreateLBCookieStickinessPolicyCommandInput} for command's `input` shape. * @see {@link CreateLBCookieStickinessPolicyCommandOutput} for command's `response` shape. * @see {@link ElasticLoadBalancingClientResolvedConfig | config} for ElasticLoadBalancingClient's `config` shape. * * @throws {@link AccessPointNotFoundException} (client fault) *

The specified load balancer does not exist.

* * @throws {@link DuplicatePolicyNameException} (client fault) *

A policy with the specified name already exists for this load balancer.

* * @throws {@link InvalidConfigurationRequestException} (client fault) *

The requested configuration change is not valid.

* * @throws {@link TooManyPoliciesException} (client fault) *

The quota for the number of policies for this load balancer has been reached.

* * @throws {@link ElasticLoadBalancingServiceException} *

Base exception class for all service exceptions from ElasticLoadBalancing service.

* * * @example To generate a duration-based stickiness policy for your load balancer * ```javascript * // This example generates a stickiness policy with sticky session lifetimes controlled by the specified expiration period. * const input = { * CookieExpirationPeriod: 60, * LoadBalancerName: "my-load-balancer", * PolicyName: "my-duration-cookie-policy" * }; * const command = new CreateLBCookieStickinessPolicyCommand(input); * const response = await client.send(command); * /* response is * { /* metadata only *\/ } * *\/ * ``` * * @public */ export declare class CreateLBCookieStickinessPolicyCommand extends CreateLBCookieStickinessPolicyCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: CreateLBCookieStickinessPolicyInput; output: {}; }; sdk: { input: CreateLBCookieStickinessPolicyCommandInput; output: CreateLBCookieStickinessPolicyCommandOutput; }; }; }