A banking web application is using Elastic load Balancer in front of web servers deployed across AZ in us-west-1 region.
The banking application has its own session cookie.
The development team wants user sessions to bind to specific instances within an AZ.
Which of the following CLI command can be used to meet this requirement?
Click on the arrows to vote for the correct answer
A. B. C. D.Correct Answer: B.
Classic Load Balancer or Elastic Load Balancer can be configured to follow the application session cookie or session cookie generated with stickiness duration.
This will make the user session bind to a specific instance.
In the above case, ELB needs to be configured to follow the banking application session cookie.
For this, you need to specify the load balancer name, policy name & cookie name.
Option A & C are incorrect as this will create a session cookie on ELB based upon time duration.
Option D is incorrect as when ELB is configured to follow the application session cookie, duration is not required to be specified.
It will follow the duration as specified in the application session cookie.
For more information on ELB CLI, refer to the following URLs-
https://docs.aws.amazon.com/cli/latest/reference/elb/create-app-cookie-stickiness-policy.htmlThe development team wants user sessions to bind to specific instances within an Availability Zone (AZ). Elastic Load Balancer (ELB) is a service provided by AWS that automatically distributes incoming traffic across multiple EC2 instances in different AZs. To bind user sessions to specific instances within an AZ, stickiness policies can be used. Stickiness policies ensure that users are directed to the same instance in the same AZ during their session.
Out of the four CLI commands given in the options, two options are using "create-lb-cookie-stickiness-policy" and two options are using "create-app-cookie-stickiness-policy". The difference between the two commands is that "create-lb-cookie-stickiness-policy" is used for sticky sessions based on the ELB cookie, and "create-app-cookie-stickiness-policy" is used for sticky sessions based on the application cookie.
Since the banking application has its own session cookie, we need to use the "create-app-cookie-stickiness-policy" command.
Option A creates an ELB cookie-based sticky session policy with a cookie expiration period of 60 seconds. This option is not suitable for the banking application because it requires using an ELB cookie, not the application cookie.
Option B creates an application cookie-based sticky session policy with a cookie name "bank-app-cookie". This option is suitable for the banking application because it uses the application cookie, and it matches the cookie name used by the banking application.
Option C creates an ELB cookie-based sticky session policy with a cookie name "bank-app-cookie". This option is not suitable for the banking application because it creates a policy based on the ELB cookie, not the application cookie.
Option D creates an application cookie-based sticky session policy with a cookie expiration period of 90 seconds. This option is not suitable for the banking application because it specifies a cookie expiration period, not the cookie name.
Therefore, the correct option is B, i.e., "aws elb create-app-cookie-stickiness-policy --load-balancer-name us-west1-load-balancer --policy-name elb-cookie-policy --cookie-name bank-app-cookie". This command creates an application cookie-based sticky session policy with a cookie name "bank-app-cookie".