aws.ec2.ProxyProtocolPolicy
Explore with Pulumi AI
Provides a proxy protocol policy, which allows an ELB to carry a client connection information to a backend.
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: 25,
instanceProtocol: "tcp",
lbPort: 25,
lbProtocol: "tcp",
},
{
instancePort: 587,
instanceProtocol: "tcp",
lbPort: 587,
lbProtocol: "tcp",
},
],
});
const smtp = new aws.ec2.ProxyProtocolPolicy("smtp", {
loadBalancer: lb.name,
instancePorts: [
"25",
"587",
],
});
import pulumi
import pulumi_aws as aws
lb = aws.elb.LoadBalancer("lb",
name="test-lb",
availability_zones=["us-east-1a"],
listeners=[
{
"instance_port": 25,
"instance_protocol": "tcp",
"lb_port": 25,
"lb_protocol": "tcp",
},
{
"instance_port": 587,
"instance_protocol": "tcp",
"lb_port": 587,
"lb_protocol": "tcp",
},
])
smtp = aws.ec2.ProxyProtocolPolicy("smtp",
load_balancer=lb.name,
instance_ports=[
"25",
"587",
])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"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(25),
InstanceProtocol: pulumi.String("tcp"),
LbPort: pulumi.Int(25),
LbProtocol: pulumi.String("tcp"),
},
&elb.LoadBalancerListenerArgs{
InstancePort: pulumi.Int(587),
InstanceProtocol: pulumi.String("tcp"),
LbPort: pulumi.Int(587),
LbProtocol: pulumi.String("tcp"),
},
},
})
if err != nil {
return err
}
_, err = ec2.NewProxyProtocolPolicy(ctx, "smtp", &ec2.ProxyProtocolPolicyArgs{
LoadBalancer: lb.Name,
InstancePorts: pulumi.StringArray{
pulumi.String("25"),
pulumi.String("587"),
},
})
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 = 25,
InstanceProtocol = "tcp",
LbPort = 25,
LbProtocol = "tcp",
},
new Aws.Elb.Inputs.LoadBalancerListenerArgs
{
InstancePort = 587,
InstanceProtocol = "tcp",
LbPort = 587,
LbProtocol = "tcp",
},
},
});
var smtp = new Aws.Ec2.ProxyProtocolPolicy("smtp", new()
{
LoadBalancer = lb.Name,
InstancePorts = new[]
{
"25",
"587",
},
});
});
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.ec2.ProxyProtocolPolicy;
import com.pulumi.aws.ec2.ProxyProtocolPolicyArgs;
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(25)
.instanceProtocol("tcp")
.lbPort(25)
.lbProtocol("tcp")
.build(),
LoadBalancerListenerArgs.builder()
.instancePort(587)
.instanceProtocol("tcp")
.lbPort(587)
.lbProtocol("tcp")
.build())
.build());
var smtp = new ProxyProtocolPolicy("smtp", ProxyProtocolPolicyArgs.builder()
.loadBalancer(lb.name())
.instancePorts(
"25",
"587")
.build());
}
}
resources:
lb:
type: aws:elb:LoadBalancer
properties:
name: test-lb
availabilityZones:
- us-east-1a
listeners:
- instancePort: 25
instanceProtocol: tcp
lbPort: 25
lbProtocol: tcp
- instancePort: 587
instanceProtocol: tcp
lbPort: 587
lbProtocol: tcp
smtp:
type: aws:ec2:ProxyProtocolPolicy
properties:
loadBalancer: ${lb.name}
instancePorts:
- '25'
- '587'
Create ProxyProtocolPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProxyProtocolPolicy(name: string, args: ProxyProtocolPolicyArgs, opts?: CustomResourceOptions);
@overload
def ProxyProtocolPolicy(resource_name: str,
args: ProxyProtocolPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProxyProtocolPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_ports: Optional[Sequence[str]] = None,
load_balancer: Optional[str] = None)
func NewProxyProtocolPolicy(ctx *Context, name string, args ProxyProtocolPolicyArgs, opts ...ResourceOption) (*ProxyProtocolPolicy, error)
public ProxyProtocolPolicy(string name, ProxyProtocolPolicyArgs args, CustomResourceOptions? opts = null)
public ProxyProtocolPolicy(String name, ProxyProtocolPolicyArgs args)
public ProxyProtocolPolicy(String name, ProxyProtocolPolicyArgs args, CustomResourceOptions options)
type: aws:ec2:ProxyProtocolPolicy
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 ProxyProtocolPolicyArgs
- 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 ProxyProtocolPolicyArgs
- 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 ProxyProtocolPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProxyProtocolPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProxyProtocolPolicyArgs
- 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 proxyProtocolPolicyResource = new Aws.Ec2.ProxyProtocolPolicy("proxyProtocolPolicyResource", new()
{
InstancePorts = new[]
{
"string",
},
LoadBalancer = "string",
});
example, err := ec2.NewProxyProtocolPolicy(ctx, "proxyProtocolPolicyResource", &ec2.ProxyProtocolPolicyArgs{
InstancePorts: pulumi.StringArray{
pulumi.String("string"),
},
LoadBalancer: pulumi.String("string"),
})
var proxyProtocolPolicyResource = new ProxyProtocolPolicy("proxyProtocolPolicyResource", ProxyProtocolPolicyArgs.builder()
.instancePorts("string")
.loadBalancer("string")
.build());
proxy_protocol_policy_resource = aws.ec2.ProxyProtocolPolicy("proxyProtocolPolicyResource",
instance_ports=["string"],
load_balancer="string")
const proxyProtocolPolicyResource = new aws.ec2.ProxyProtocolPolicy("proxyProtocolPolicyResource", {
instancePorts: ["string"],
loadBalancer: "string",
});
type: aws:ec2:ProxyProtocolPolicy
properties:
instancePorts:
- string
loadBalancer: string
ProxyProtocolPolicy 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 ProxyProtocolPolicy resource accepts the following input properties:
- Instance
Ports List<string> - List of instance ports to which the policy should be applied. This can be specified if the protocol is SSL or TCP.
- Load
Balancer string - The load balancer to which the policy should be attached.
- Instance
Ports []string - List of instance ports to which the policy should be applied. This can be specified if the protocol is SSL or TCP.
- Load
Balancer string - The load balancer to which the policy should be attached.
- instance
Ports List<String> - List of instance ports to which the policy should be applied. This can be specified if the protocol is SSL or TCP.
- load
Balancer String - The load balancer to which the policy should be attached.
- instance
Ports string[] - List of instance ports to which the policy should be applied. This can be specified if the protocol is SSL or TCP.
- load
Balancer string - The load balancer to which the policy should be attached.
- instance_
ports Sequence[str] - List of instance ports to which the policy should be applied. This can be specified if the protocol is SSL or TCP.
- load_
balancer str - The load balancer to which the policy should be attached.
- instance
Ports List<String> - List of instance ports to which the policy should be applied. This can be specified if the protocol is SSL or TCP.
- load
Balancer String - The load balancer to which the policy should be attached.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProxyProtocolPolicy 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 ProxyProtocolPolicy Resource
Get an existing ProxyProtocolPolicy 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?: ProxyProtocolPolicyState, opts?: CustomResourceOptions): ProxyProtocolPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
instance_ports: Optional[Sequence[str]] = None,
load_balancer: Optional[str] = None) -> ProxyProtocolPolicy
func GetProxyProtocolPolicy(ctx *Context, name string, id IDInput, state *ProxyProtocolPolicyState, opts ...ResourceOption) (*ProxyProtocolPolicy, error)
public static ProxyProtocolPolicy Get(string name, Input<string> id, ProxyProtocolPolicyState? state, CustomResourceOptions? opts = null)
public static ProxyProtocolPolicy get(String name, Output<String> id, ProxyProtocolPolicyState 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.
- Instance
Ports List<string> - List of instance ports to which the policy should be applied. This can be specified if the protocol is SSL or TCP.
- Load
Balancer string - The load balancer to which the policy should be attached.
- Instance
Ports []string - List of instance ports to which the policy should be applied. This can be specified if the protocol is SSL or TCP.
- Load
Balancer string - The load balancer to which the policy should be attached.
- instance
Ports List<String> - List of instance ports to which the policy should be applied. This can be specified if the protocol is SSL or TCP.
- load
Balancer String - The load balancer to which the policy should be attached.
- instance
Ports string[] - List of instance ports to which the policy should be applied. This can be specified if the protocol is SSL or TCP.
- load
Balancer string - The load balancer to which the policy should be attached.
- instance_
ports Sequence[str] - List of instance ports to which the policy should be applied. This can be specified if the protocol is SSL or TCP.
- load_
balancer str - The load balancer to which the policy should be attached.
- instance
Ports List<String> - List of instance ports to which the policy should be applied. This can be specified if the protocol is SSL or TCP.
- load
Balancer String - The load balancer to which the policy should be attached.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.