LbStickinessPolicyArgs

data class LbStickinessPolicyArgs(val cookieDuration: Output<Int>? = null, val enabled: Output<Boolean>? = null, val lbName: Output<String>? = null) : ConvertibleToJava<LbStickinessPolicyArgs>

Configures Session Stickiness for a Lightsail Load Balancer.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lightsail.Lb;
import com.pulumi.aws.lightsail.LbArgs;
import com.pulumi.aws.lightsail.LbStickinessPolicy;
import com.pulumi.aws.lightsail.LbStickinessPolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var testLb = new Lb("testLb", LbArgs.builder()
.healthCheckPath("/")
.instancePort("80")
.tags(Map.of("foo", "bar"))
.build());
var testLbStickinessPolicy = new LbStickinessPolicy("testLbStickinessPolicy", LbStickinessPolicyArgs.builder()
.lbName(testLb.name())
.cookieDuration(900)
.enabled(true)
.build());
}
}

Import

aws_lightsail_lb_stickiness_policy can be imported by using the lb_name attribute, e.g.,

$ pulumi import aws:lightsail/lbStickinessPolicy:LbStickinessPolicy test example-load-balancer

Constructors

Link copied to clipboard
constructor(cookieDuration: Output<Int>? = null, enabled: Output<Boolean>? = null, lbName: Output<String>? = null)

Properties

Link copied to clipboard
val cookieDuration: Output<Int>? = null

The cookie duration in seconds. This determines the length of the session stickiness.

Link copied to clipboard
val enabled: Output<Boolean>? = null

The Session Stickiness state of the load balancer. true to activate session stickiness or false to deactivate session stickiness.

Link copied to clipboard
val lbName: Output<String>? = null

The name of the load balancer to which you want to enable session stickiness.

Functions

Link copied to clipboard
open override fun toJava(): LbStickinessPolicyArgs