Provides an application cookie stickiness policy, which allows an ELB to wed its sticky cookie's expiration to a cookie generated by your application.
resource "aws_elb" "lb" {
name = "test-lb"
availability_zones = ["us-east-1a"]
listener {
instance_port = 8000
instance_protocol = "http"
lb_port = 80
lb_protocol = "http"
}
}
resource "aws_app_cookie_stickiness_policy" "foo" {
name = "foo_policy"
load_balancer = aws_elb.lb.name
lb_port = 80
cookie_name = "MyAppCookie"
}
This resource supports the following arguments:
name
- (Required) Name of the stickiness policy.load_balancer
- (Required) Name of load balancer to which the policy
should be attached.lb_port
- (Required) Load balancer port to which the policy
should be applied. This must be an active listener on the load
balancer.cookie_name
- (Required) Application cookie whose lifetime the ELB's cookie should follow.This resource exports the following attributes in addition to the arguments above:
id
- ID of the policy.name
- Name of the stickiness policy.load_balancer
- Name of load balancer to which the policy is attached.lb_port
- Load balancer port to which the policy is applied.cookie_name
- Application cookie whose lifetime the ELB's cookie should follow.In Terraform v1.5.0 and later, use an import
block to import application cookie stickiness policies using the ELB name, port, and policy name separated by colons (:
). For example:
import {
to = aws_app_cookie_stickiness_policy.example
id = "my-elb:80:my-policy"
}
Using terraform import
, import application cookie stickiness policies using the ELB name, port, and policy name separated by colons (:
). For example:
% terraform import aws_app_cookie_stickiness_policy.example my-elb:80:my-policy