Class ListenerPolicy
Attaches a load balancer policy to an ELB Listener.
Example Usage for Custom Policy
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var wu_tang = new Aws.Elb.LoadBalancer("wu-tang", new Aws.Elb.LoadBalancerArgs
{
AvailabilityZones =
{
"us-east-1a",
},
Listeners =
{
new Aws.Elb.Inputs.LoadBalancerListenerArgs
{
InstancePort = 443,
InstanceProtocol = "http",
LbPort = 443,
LbProtocol = "https",
SslCertificateId = "arn:aws:iam::000000000000:server-certificate/wu-tang.net",
},
},
Tags =
{
{ "Name", "wu-tang" },
},
});
var wu_tang_ssl = new Aws.Elb.LoadBalancerPolicy("wu-tang-ssl", new Aws.Elb.LoadBalancerPolicyArgs
{
LoadBalancerName = wu_tang.Name,
PolicyAttributes =
{
new Aws.Elb.Inputs.LoadBalancerPolicyPolicyAttributeArgs
{
Name = "ECDHE-ECDSA-AES128-GCM-SHA256",
Value = "true",
},
new Aws.Elb.Inputs.LoadBalancerPolicyPolicyAttributeArgs
{
Name = "Protocol-TLSv1.2",
Value = "true",
},
},
PolicyName = "wu-tang-ssl",
PolicyTypeName = "SSLNegotiationPolicyType",
});
var wu_tang_listener_policies_443 = new Aws.Elb.ListenerPolicy("wu-tang-listener-policies-443", new Aws.Elb.ListenerPolicyArgs
{
LoadBalancerName = wu_tang.Name,
LoadBalancerPort = 443,
PolicyNames =
{
wu_tang_ssl.PolicyName,
},
});
}
}
This example shows how to customize the TLS settings of an HTTPS listener.
Example Usage for AWS Predefined Security Policy
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var wu_tang = new Aws.Elb.LoadBalancer("wu-tang", new Aws.Elb.LoadBalancerArgs
{
AvailabilityZones =
{
"us-east-1a",
},
Listeners =
{
new Aws.Elb.Inputs.LoadBalancerListenerArgs
{
InstancePort = 443,
InstanceProtocol = "http",
LbPort = 443,
LbProtocol = "https",
SslCertificateId = "arn:aws:iam::000000000000:server-certificate/wu-tang.net",
},
},
Tags =
{
{ "Name", "wu-tang" },
},
});
var wu_tang_ssl_tls_1_1 = new Aws.Elb.LoadBalancerPolicy("wu-tang-ssl-tls-1-1", new Aws.Elb.LoadBalancerPolicyArgs
{
LoadBalancerName = wu_tang.Name,
PolicyAttributes =
{
new Aws.Elb.Inputs.LoadBalancerPolicyPolicyAttributeArgs
{
Name = "Reference-Security-Policy",
Value = "ELBSecurityPolicy-TLS-1-1-2017-01",
},
},
PolicyName = "wu-tang-ssl",
PolicyTypeName = "SSLNegotiationPolicyType",
});
var wu_tang_listener_policies_443 = new Aws.Elb.ListenerPolicy("wu-tang-listener-policies-443", new Aws.Elb.ListenerPolicyArgs
{
LoadBalancerName = wu_tang.Name,
LoadBalancerPort = 443,
PolicyNames =
{
wu_tang_ssl_tls_1_1.PolicyName,
},
});
}
}
This example shows how to add a Predefined Security Policy for ELBs
Inherited Members
Namespace: Pulumi.Aws.ElasticLoadBalancing
Assembly: Pulumi.Aws.dll
Syntax
[Obsolete("aws.elasticloadbalancing.ListenerPolicy has been deprecated in favor of aws.elb.ListenerPolicy")]
public class ListenerPolicy : CustomResource
Constructors
View SourceListenerPolicy(String, ListenerPolicyArgs, CustomResourceOptions)
Create a ListenerPolicy resource with the given unique name, arguments, and options.
Declaration
public ListenerPolicy(string name, ListenerPolicyArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ListenerPolicyArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceLoadBalancerName
The load balancer to attach the policy to.
Declaration
public Output<string> LoadBalancerName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
LoadBalancerPort
The load balancer listener port to apply the policy to.
Declaration
public Output<int> LoadBalancerPort { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
PolicyNames
List of Policy Names to apply to the backend server.
Declaration
public Output<ImmutableArray<string>> PolicyNames { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Methods
View SourceGet(String, Input<String>, ListenerPolicyState, CustomResourceOptions)
Get an existing ListenerPolicy resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static ListenerPolicy Get(string name, Input<string> id, ListenerPolicyState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| ListenerPolicyState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| ListenerPolicy |