AWS Classic

v5.16.0 published on Saturday, Sep 24, 2022 by Pulumi

AppCookieStickinessPolicy

Deprecated:

aws.elasticloadbalancing.AppCookieStickinessPolicy has been deprecated in favor of aws.elb.AppCookieStickinessPolicy

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

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var lb = new Aws.Elb.LoadBalancer("lb", new()
    {
        AvailabilityZones = new[]
        {
            "us-east-1a",
        },
        Listeners = new[]
        {
            new Aws.Elb.Inputs.LoadBalancerListenerArgs
            {
                InstancePort = 8000,
                InstanceProtocol = "http",
                LbPort = 80,
                LbProtocol = "http",
            },
        },
    });

    var foo = new Aws.Elb.AppCookieStickinessPolicy("foo", new()
    {
        LoadBalancer = lb.Name,
        LbPort = 80,
        CookieName = "MyAppCookie",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/elb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		lb, err := elb.NewLoadBalancer(ctx, "lb", &elb.LoadBalancerArgs{
			AvailabilityZones: pulumi.StringArray{
				pulumi.String("us-east-1a"),
			},
			Listeners: elb.LoadBalancerListenerArray{
				&elb.LoadBalancerListenerArgs{
					InstancePort:     pulumi.Int(8000),
					InstanceProtocol: pulumi.String("http"),
					LbPort:           pulumi.Int(80),
					LbProtocol:       pulumi.String("http"),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = elb.NewAppCookieStickinessPolicy(ctx, "foo", &elb.AppCookieStickinessPolicyArgs{
			LoadBalancer: lb.Name,
			LbPort:       pulumi.Int(80),
			CookieName:   pulumi.String("MyAppCookie"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.elb.LoadBalancer;
import com.pulumi.aws.elb.LoadBalancerArgs;
import com.pulumi.aws.elb.inputs.LoadBalancerListenerArgs;
import com.pulumi.aws.elb.AppCookieStickinessPolicy;
import com.pulumi.aws.elb.AppCookieStickinessPolicyArgs;
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 lb = new LoadBalancer("lb", LoadBalancerArgs.builder()        
            .availabilityZones("us-east-1a")
            .listeners(LoadBalancerListenerArgs.builder()
                .instancePort(8000)
                .instanceProtocol("http")
                .lbPort(80)
                .lbProtocol("http")
                .build())
            .build());

        var foo = new AppCookieStickinessPolicy("foo", AppCookieStickinessPolicyArgs.builder()        
            .loadBalancer(lb.name())
            .lbPort(80)
            .cookieName("MyAppCookie")
            .build());

    }
}
import pulumi
import pulumi_aws as aws

lb = aws.elb.LoadBalancer("lb",
    availability_zones=["us-east-1a"],
    listeners=[aws.elb.LoadBalancerListenerArgs(
        instance_port=8000,
        instance_protocol="http",
        lb_port=80,
        lb_protocol="http",
    )])
foo = aws.elb.AppCookieStickinessPolicy("foo",
    load_balancer=lb.name,
    lb_port=80,
    cookie_name="MyAppCookie")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const lb = new aws.elb.LoadBalancer("lb", {
    availabilityZones: ["us-east-1a"],
    listeners: [{
        instancePort: 8000,
        instanceProtocol: "http",
        lbPort: 80,
        lbProtocol: "http",
    }],
});
const foo = new aws.elb.AppCookieStickinessPolicy("foo", {
    loadBalancer: lb.name,
    lbPort: 80,
    cookieName: "MyAppCookie",
});
resources:
  lb:
    type: aws:elb:LoadBalancer
    properties:
      availabilityZones:
        - us-east-1a
      listeners:
        - instancePort: 8000
          instanceProtocol: http
          lbPort: 80
          lbProtocol: http
  foo:
    type: aws:elb:AppCookieStickinessPolicy
    properties:
      loadBalancer: ${lb.name}
      lbPort: 80
      cookieName: MyAppCookie

Create a AppCookieStickinessPolicy Resource

new AppCookieStickinessPolicy(name: string, args: AppCookieStickinessPolicyArgs, opts?: CustomResourceOptions);
@overload
def AppCookieStickinessPolicy(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              cookie_name: Optional[str] = None,
                              lb_port: Optional[int] = None,
                              load_balancer: Optional[str] = None,
                              name: Optional[str] = None)
@overload
def AppCookieStickinessPolicy(resource_name: str,
                              args: AppCookieStickinessPolicyArgs,
                              opts: Optional[ResourceOptions] = None)
func NewAppCookieStickinessPolicy(ctx *Context, name string, args AppCookieStickinessPolicyArgs, opts ...ResourceOption) (*AppCookieStickinessPolicy, error)
public AppCookieStickinessPolicy(string name, AppCookieStickinessPolicyArgs args, CustomResourceOptions? opts = null)
public AppCookieStickinessPolicy(String name, AppCookieStickinessPolicyArgs args)
public AppCookieStickinessPolicy(String name, AppCookieStickinessPolicyArgs args, CustomResourceOptions options)
type: aws:elasticloadbalancing:AppCookieStickinessPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args AppCookieStickinessPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args AppCookieStickinessPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AppCookieStickinessPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AppCookieStickinessPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AppCookieStickinessPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

AppCookieStickinessPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The AppCookieStickinessPolicy resource accepts the following input properties:

CookieName string

Application cookie whose lifetime the ELB's cookie should follow.

LbPort int

Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.

LoadBalancer string

Name of load balancer to which the policy should be attached.

Name string

Name of the stickiness policy.

CookieName string

Application cookie whose lifetime the ELB's cookie should follow.

LbPort int

Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.

LoadBalancer string

Name of load balancer to which the policy should be attached.

Name string

Name of the stickiness policy.

cookieName String

Application cookie whose lifetime the ELB's cookie should follow.

lbPort Integer

Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.

loadBalancer String

Name of load balancer to which the policy should be attached.

name String

Name of the stickiness policy.

cookieName string

Application cookie whose lifetime the ELB's cookie should follow.

lbPort number

Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.

loadBalancer string

Name of load balancer to which the policy should be attached.

name string

Name of the stickiness policy.

cookie_name str

Application cookie whose lifetime the ELB's cookie should follow.

lb_port int

Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.

load_balancer str

Name of load balancer to which the policy should be attached.

name str

Name of the stickiness policy.

cookieName String

Application cookie whose lifetime the ELB's cookie should follow.

lbPort Number

Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.

loadBalancer String

Name of load balancer to which the policy should be attached.

name String

Name of the stickiness policy.

Outputs

All input properties are implicitly available as output properties. Additionally, the AppCookieStickinessPolicy resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing AppCookieStickinessPolicy Resource

Get an existing AppCookieStickinessPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: AppCookieStickinessPolicyState, opts?: CustomResourceOptions): AppCookieStickinessPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cookie_name: Optional[str] = None,
        lb_port: Optional[int] = None,
        load_balancer: Optional[str] = None,
        name: Optional[str] = None) -> AppCookieStickinessPolicy
func GetAppCookieStickinessPolicy(ctx *Context, name string, id IDInput, state *AppCookieStickinessPolicyState, opts ...ResourceOption) (*AppCookieStickinessPolicy, error)
public static AppCookieStickinessPolicy Get(string name, Input<string> id, AppCookieStickinessPolicyState? state, CustomResourceOptions? opts = null)
public static AppCookieStickinessPolicy get(String name, Output<String> id, AppCookieStickinessPolicyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CookieName string

Application cookie whose lifetime the ELB's cookie should follow.

LbPort int

Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.

LoadBalancer string

Name of load balancer to which the policy should be attached.

Name string

Name of the stickiness policy.

CookieName string

Application cookie whose lifetime the ELB's cookie should follow.

LbPort int

Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.

LoadBalancer string

Name of load balancer to which the policy should be attached.

Name string

Name of the stickiness policy.

cookieName String

Application cookie whose lifetime the ELB's cookie should follow.

lbPort Integer

Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.

loadBalancer String

Name of load balancer to which the policy should be attached.

name String

Name of the stickiness policy.

cookieName string

Application cookie whose lifetime the ELB's cookie should follow.

lbPort number

Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.

loadBalancer string

Name of load balancer to which the policy should be attached.

name string

Name of the stickiness policy.

cookie_name str

Application cookie whose lifetime the ELB's cookie should follow.

lb_port int

Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.

load_balancer str

Name of load balancer to which the policy should be attached.

name str

Name of the stickiness policy.

cookieName String

Application cookie whose lifetime the ELB's cookie should follow.

lbPort Number

Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.

loadBalancer String

Name of load balancer to which the policy should be attached.

name String

Name of the stickiness policy.

Import

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

 $ pulumi import aws:elasticloadbalancing/appCookieStickinessPolicy:AppCookieStickinessPolicy example my-elb:80:my-policy

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.