AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Container for the parameters to the CreateLoadBalancerPolicy operation. Creates a policy with the specified attributes for the specified load balancer.

Policies are settings that are saved for your load balancer and that can be applied to the listener or the application server, depending on the policy type.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.ElasticLoadBalancing.AmazonElasticLoadBalancingRequest
      Amazon.ElasticLoadBalancing.Model.CreateLoadBalancerPolicyRequest

Namespace: Amazon.ElasticLoadBalancing.Model
Assembly: AWSSDK.ElasticLoadBalancing.dll
Version: 3.x.y.z

Syntax

C#
public class CreateLoadBalancerPolicyRequest : AmazonElasticLoadBalancingRequest
         IAmazonWebServiceRequest

The CreateLoadBalancerPolicyRequest type exposes the following members

Constructors

Properties

NameTypeDescription
Public Property LoadBalancerName System.String

Gets and sets the property LoadBalancerName.

The name of the load balancer.

Public Property PolicyAttributes System.Collections.Generic.List<Amazon.ElasticLoadBalancing.Model.PolicyAttribute>

Gets and sets the property PolicyAttributes.

The policy attributes.

Public Property PolicyName System.String

Gets and sets the property PolicyName.

The name of the load balancer policy to be created. This name must be unique within the set of policies for this load balancer.

Public Property PolicyTypeName System.String

Gets and sets the property PolicyTypeName.

The name of the base policy type. To get the list of policy types, use DescribeLoadBalancerPolicyTypes.

Examples

This example creates a policy that enables Proxy Protocol on the specified load balancer.

To create a policy that enables Proxy Protocol on a load balancer


var client = new AmazonElasticLoadBalancingClient();
var response = client.CreateLoadBalancerPolicy(new CreateLoadBalancerPolicyRequest 
{
    LoadBalancerName = "my-load-balancer",
    PolicyAttributes = new List<PolicyAttribute> {
        new PolicyAttribute {
            AttributeName = "ProxyProtocol",
            AttributeValue = "true"
        }
    },
    PolicyName = "my-ProxyProtocol-policy",
    PolicyTypeName = "ProxyProtocolPolicyType"
});


            

This example creates a public key policy.

To create a public key policy


var client = new AmazonElasticLoadBalancingClient();
var response = client.CreateLoadBalancerPolicy(new CreateLoadBalancerPolicyRequest 
{
    LoadBalancerName = "my-load-balancer",
    PolicyAttributes = new List<PolicyAttribute> {
        new PolicyAttribute {
            AttributeName = "PublicKey",
            AttributeValue = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwAYUjnfyEyXr1pxjhFWBpMlggUcqoi3kl+dS74kj//c6x7ROtusUaeQCTgIUkayttRDWchuqo1pHC1u+n5xxXnBBe2ejbb2WRsKIQ5rXEeixsjFpFsojpSQKkzhVGI6mJVZBJDVKSHmswnwLBdofLhzvllpovBPTHe+o4haAWvDBALJU0pkSI1FecPHcs2hwxf14zHoXy1e2k36A64nXW43wtfx5qcVSIxtCEOjnYRg7RPvybaGfQ+v6Iaxb/+7J5kEvZhTFQId+bSiJImF1FSUT1W1xwzBZPUbcUkkXDj45vC2s3Z8E+Lk7a3uZhvsQHLZnrfuWjBWGWvZ/MhZYgEXAMPLE"
        }
    },
    PolicyName = "my-PublicKey-policy",
    PolicyTypeName = "PublicKeyPolicyType"
});


            

This example creates a backend server authentication policy that enables authentication on your backend instance using a public key policy.

To create a backend server authentication policy


var client = new AmazonElasticLoadBalancingClient();
var response = client.CreateLoadBalancerPolicy(new CreateLoadBalancerPolicyRequest 
{
    LoadBalancerName = "my-load-balancer",
    PolicyAttributes = new List<PolicyAttribute> {
        new PolicyAttribute {
            AttributeName = "PublicKeyPolicyName",
            AttributeValue = "my-PublicKey-policy"
        }
    },
    PolicyName = "my-authentication-policy",
    PolicyTypeName = "BackendServerAuthenticationPolicyType"
});


            

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5 and newer, 3.5