Use CreateAppCookieStickinessPolicy with a CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use CreateAppCookieStickinessPolicy with a CLI

The following code examples show how to use CreateAppCookieStickinessPolicy.

CLI
AWS CLI

To generate a stickiness policy for your HTTPS load balancer

This example generates a stickiness policy that follows the sticky session lifetimes of the application-generated cookie.

Command:

aws elb create-app-cookie-stickiness-policy --load-balancer-name my-load-balancer --policy-name my-app-cookie-policy --cookie-name my-app-cookie
PowerShell
Tools for PowerShell

Example 1: This example creates a stickiness policy that follows the sticky session lifetimes of the specified application-generated cookie.

New-ELBAppCookieStickinessPolicy -LoadBalancerName my-load-balancer -PolicyName my-app-cookie-policy -CookieName my-app-cookie