Skip to content

Resource: awsAppCookieStickinessPolicy

Provides an application cookie stickiness policy, which allows an ELB to wed its sticky cookie's expiration to a cookie generated by your application.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsElbLb = new aws.elb.Elb(this, "lb", {
  availabilityZones: ["us-east-1a"],
  listener: [
    {
      instancePort: 8000,
      instanceProtocol: "http",
      lbPort: 80,
      lbProtocol: "http",
    },
  ],
  name: "test-lb",
});
new aws.appCookieStickinessPolicy.AppCookieStickinessPolicy(this, "foo", {
  cookieName: "MyAppCookie",
  lbPort: 80,
  loadBalancer: awsElbLb.name,
  name: "foo_policy",
});

Argument Reference

The following arguments are supported:

  • name - (Required) Name of the stickiness policy.
  • loadBalancer - (Required) Name of load balancer to which the policy should be attached.
  • lbPort - (Required) Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.
  • cookieName - (Required) Application cookie whose lifetime the ELB's cookie should follow.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - ID of the policy.
  • name - Name of the stickiness policy.
  • loadBalancer - Name of load balancer to which the policy is attached.
  • lbPort - Load balancer port to which the policy is applied.
  • cookieName - Application cookie whose lifetime the ELB's cookie should follow.

Import

Application cookie stickiness policies can be imported using the ELB name, port, and policy name separated by colons (:), e.g.,

$ terraform import aws_app_cookie_stickiness_policy.example my-elb:80:my-policy