Show / Hide Table of Contents

Class LoadBalancerProps

Construction properties for a LoadBalancer.

Inheritance
object
LoadBalancerProps
Implements
ILoadBalancerProps
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.ElasticLoadBalancing
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class LoadBalancerProps : ILoadBalancerProps
Syntax (vb)
Public Class LoadBalancerProps Implements ILoadBalancerProps
Remarks

ExampleMetadata: infused

Examples
Cluster cluster;
            TaskDefinition taskDefinition;
            Vpc vpc;

            var service = new Ec2Service(this, "Service", new Ec2ServiceProps { Cluster = cluster, TaskDefinition = taskDefinition, MinHealthyPercent = 100 });

            var lb = new LoadBalancer(this, "LB", new LoadBalancerProps { Vpc = vpc });
            lb.AddListener(new LoadBalancerListener { ExternalPort = 80 });
            lb.AddTarget(service);

Synopsis

Constructors

LoadBalancerProps()

Construction properties for a LoadBalancer.

Properties

AccessLoggingPolicy

Enable Loadbalancer access logs Can be used to avoid manual work as aws console Required S3 bucket name , enabled flag Can add interval for pushing log Can set bucket prefix in order to provide folder name inside bucket.

CrossZone

Whether cross zone load balancing is enabled.

HealthCheck

Health check settings for the load balancing targets.

InternetFacing

Whether this is an internet-facing Load Balancer.

Listeners

What listeners to set up for the load balancer.

SubnetSelection

Which subnets to deploy the load balancer.

Targets

What targets to load balance to.

Vpc

VPC network of the fleet instances.

Constructors

LoadBalancerProps()

Construction properties for a LoadBalancer.

public LoadBalancerProps()
Remarks

ExampleMetadata: infused

Examples
Cluster cluster;
            TaskDefinition taskDefinition;
            Vpc vpc;

            var service = new Ec2Service(this, "Service", new Ec2ServiceProps { Cluster = cluster, TaskDefinition = taskDefinition, MinHealthyPercent = 100 });

            var lb = new LoadBalancer(this, "LB", new LoadBalancerProps { Vpc = vpc });
            lb.AddListener(new LoadBalancerListener { ExternalPort = 80 });
            lb.AddTarget(service);

Properties

AccessLoggingPolicy

Enable Loadbalancer access logs Can be used to avoid manual work as aws console Required S3 bucket name , enabled flag Can add interval for pushing log Can set bucket prefix in order to provide folder name inside bucket.

public CfnLoadBalancer.IAccessLoggingPolicyProperty? AccessLoggingPolicy { get; set; }
Property Value

CfnLoadBalancer.IAccessLoggingPolicyProperty

Remarks

Default: - disabled

CrossZone

Whether cross zone load balancing is enabled.

public bool? CrossZone { get; set; }
Property Value

bool?

Remarks

This controls whether the load balancer evenly distributes requests across each availability zone

Default: true

HealthCheck

Health check settings for the load balancing targets.

public IHealthCheck? HealthCheck { get; set; }
Property Value

IHealthCheck

Remarks

Not required but recommended.

Default: - None.

InternetFacing

Whether this is an internet-facing Load Balancer.

public bool? InternetFacing { get; set; }
Property Value

bool?

Remarks

This controls whether the LB has a public IP address assigned. It does not open up the Load Balancer's security groups to public internet access.

Default: false

Listeners

What listeners to set up for the load balancer.

public ILoadBalancerListener[]? Listeners { get; set; }
Property Value

ILoadBalancerListener[]

Remarks

Can also be added by .addListener()

Default: -

SubnetSelection

Which subnets to deploy the load balancer.

public ISubnetSelection? SubnetSelection { get; set; }
Property Value

ISubnetSelection

Remarks

Can be used to define a specific set of subnets to deploy the load balancer to. Useful multiple public or private subnets are covering the same availability zone.

Default: - Public subnets if internetFacing, Private subnets otherwise

Targets

What targets to load balance to.

public ILoadBalancerTarget[]? Targets { get; set; }
Property Value

ILoadBalancerTarget[]

Remarks

Can also be added by .addTarget()

Default: - None.

Vpc

VPC network of the fleet instances.

public IVpc Vpc { get; set; }
Property Value

IVpc

Remarks

ExampleMetadata: infused

Implements

ILoadBalancerProps
Back to top Generated by DocFX