Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

To enable duration-based sticky sessions for a load balancer using the AWS CLI

Sumit Rawal answered on May 20, 2023 Popularity 3/10 Helpfulness 1/10

Contents


More Related Answers

  • GET LIST OF LOAD BALANCERS AWS CLI
  • What are the different types of load balancers in AWS?
  • Your application running on a fleet of EC2 instances managed by an Auto Scaling Group behind an Application Load Balancer. Users have to constantly log back in and you don't want to enable Sticky Sessions on your ALB as you fear it will overload some EC2
  • What are the different uses of the various load balancers in AWS Elastic Load Balancing?
  • aws-sdk-go-v2 - Loading AWS Shared Configuration
  • AWS offers three types of load balancers:
  • Configure sticky sessions for your Classic Load Balancer
  • To enable duration-based sticky sessions for a load balancer using the console

  • To enable duration-based sticky sessions for a load balancer using the AWS CLI

    0

    Use the following create-lb-cookie-stickiness-policy command to create a load balancer-generated cookie stickiness policy with a cookie expiration period of 60 seconds:

    aws elb create-lb-cookie-stickiness-policy --load-balancer-name my-loadbalancer --policy-name my-duration-cookie-policy --cookie-expiration-period 60

    Use the following set-load-balancer-policies-of-listener command to enable session stickiness for the specified load balancer:

    aws elb set-load-balancer-policies-of-listener --load-balancer-name my-loadbalancer --load-balancer-port 443 --policy-names my-duration-cookie-policy

    Note

    The set-load-balancer-policies-of-listener command replaces the current set of policies associated with the specified load balancer port. Every time you use this command, specify the --policy-names option to list all policies to enable.

    (Optional) Use the following describe-load-balancers command to verify that the policy is enabled:

    aws elb describe-load-balancers --load-balancer-name my-loadbalancer

    The response includes the following information, which shows that the policy is enabled for the listener on the specified port: 

    Popularity 3/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on May 20 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.