aws.elb.AppCookieStickinessPolicy
Explore with Pulumi AI
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
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const lb = new aws.elb.LoadBalancer("lb", {
name: "test-lb",
availabilityZones: ["us-east-1a"],
listeners: [{
instancePort: 8000,
instanceProtocol: "http",
lbPort: 80,
lbProtocol: "http",
}],
});
const foo = new aws.elb.AppCookieStickinessPolicy("foo", {
name: "foo_policy",
loadBalancer: lb.name,
lbPort: 80,
cookieName: "MyAppCookie",
});
import pulumi
import pulumi_aws as aws
lb = aws.elb.LoadBalancer("lb",
name="test-lb",
availability_zones=["us-east-1a"],
listeners=[{
"instance_port": 8000,
"instance_protocol": "http",
"lb_port": 80,
"lb_protocol": "http",
}])
foo = aws.elb.AppCookieStickinessPolicy("foo",
name="foo_policy",
load_balancer=lb.name,
lb_port=80,
cookie_name="MyAppCookie")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/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{
Name: pulumi.String("test-lb"),
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{
Name: pulumi.String("foo_policy"),
LoadBalancer: lb.Name,
LbPort: pulumi.Int(80),
CookieName: pulumi.String("MyAppCookie"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var lb = new Aws.Elb.LoadBalancer("lb", new()
{
Name = "test-lb",
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()
{
Name = "foo_policy",
LoadBalancer = lb.Name,
LbPort = 80,
CookieName = "MyAppCookie",
});
});
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()
.name("test-lb")
.availabilityZones("us-east-1a")
.listeners(LoadBalancerListenerArgs.builder()
.instancePort(8000)
.instanceProtocol("http")
.lbPort(80)
.lbProtocol("http")
.build())
.build());
var foo = new AppCookieStickinessPolicy("foo", AppCookieStickinessPolicyArgs.builder()
.name("foo_policy")
.loadBalancer(lb.name())
.lbPort(80)
.cookieName("MyAppCookie")
.build());
}
}
resources:
lb:
type: aws:elb:LoadBalancer
properties:
name: test-lb
availabilityZones:
- us-east-1a
listeners:
- instancePort: 8000
instanceProtocol: http
lbPort: 80
lbProtocol: http
foo:
type: aws:elb:AppCookieStickinessPolicy
properties:
name: foo_policy
loadBalancer: ${lb.name}
lbPort: 80
cookieName: MyAppCookie
Create AppCookieStickinessPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AppCookieStickinessPolicy(name: string, args: AppCookieStickinessPolicyArgs, opts?: CustomResourceOptions);
@overload
def AppCookieStickinessPolicy(resource_name: str,
args: AppCookieStickinessPolicyArgs,
opts: Optional[ResourceOptions] = None)
@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)
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:elb:AppCookieStickinessPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var appCookieStickinessPolicyResource = new Aws.Elb.AppCookieStickinessPolicy("appCookieStickinessPolicyResource", new()
{
CookieName = "string",
LbPort = 0,
LoadBalancer = "string",
Name = "string",
});
example, err := elb.NewAppCookieStickinessPolicy(ctx, "appCookieStickinessPolicyResource", &elb.AppCookieStickinessPolicyArgs{
CookieName: pulumi.String("string"),
LbPort: pulumi.Int(0),
LoadBalancer: pulumi.String("string"),
Name: pulumi.String("string"),
})
var appCookieStickinessPolicyResource = new AppCookieStickinessPolicy("appCookieStickinessPolicyResource", AppCookieStickinessPolicyArgs.builder()
.cookieName("string")
.lbPort(0)
.loadBalancer("string")
.name("string")
.build());
app_cookie_stickiness_policy_resource = aws.elb.AppCookieStickinessPolicy("appCookieStickinessPolicyResource",
cookie_name="string",
lb_port=0,
load_balancer="string",
name="string")
const appCookieStickinessPolicyResource = new aws.elb.AppCookieStickinessPolicy("appCookieStickinessPolicyResource", {
cookieName: "string",
lbPort: 0,
loadBalancer: "string",
name: "string",
});
type: aws:elb:AppCookieStickinessPolicy
properties:
cookieName: string
lbPort: 0
loadBalancer: string
name: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AppCookieStickinessPolicy resource accepts the following input properties:
- string
- 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 string - Name of load balancer to which the policy should be attached.
- Name string
- Name of the stickiness policy.
- string
- 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 string - Name of load balancer to which the policy should be attached.
- Name string
- Name of the stickiness policy.
- String
- Application cookie whose lifetime the ELB's cookie should follow.
- lb
Port Integer - Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.
- load
Balancer String - Name of load balancer to which the policy should be attached.
- name String
- Name of the stickiness policy.
- string
- Application cookie whose lifetime the ELB's cookie should follow.
- lb
Port number - Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.
- load
Balancer string - Name of load balancer to which the policy should be attached.
- name string
- Name of the stickiness policy.
- 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.
- String
- Application cookie whose lifetime the ELB's cookie should follow.
- lb
Port Number - Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.
- load
Balancer 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 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.
- string
- 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 string - Name of load balancer to which the policy should be attached.
- Name string
- Name of the stickiness policy.
- string
- 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 string - Name of load balancer to which the policy should be attached.
- Name string
- Name of the stickiness policy.
- String
- Application cookie whose lifetime the ELB's cookie should follow.
- lb
Port Integer - Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.
- load
Balancer String - Name of load balancer to which the policy should be attached.
- name String
- Name of the stickiness policy.
- string
- Application cookie whose lifetime the ELB's cookie should follow.
- lb
Port number - Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.
- load
Balancer string - Name of load balancer to which the policy should be attached.
- name string
- Name of the stickiness policy.
- 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.
- String
- Application cookie whose lifetime the ELB's cookie should follow.
- lb
Port Number - Load balancer port to which the policy should be applied. This must be an active listener on the load balancer.
- load
Balancer String - Name of load balancer to which the policy should be attached.
- name String
- Name of the stickiness policy.
Import
Using pulumi import
, import application cookie stickiness policies using the ELB name, port, and policy name separated by colons (:
). For example:
$ pulumi import aws:elb/appCookieStickinessPolicy:AppCookieStickinessPolicy example my-elb:80:my-policy
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.