Class ApplicationLoadBalancerProps
Properties for defining an Application Load Balancer.
Inheritance
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.AWS.ElasticLoadBalancingV2.dll
Syntax (csharp)
public class ApplicationLoadBalancerProps : Object, IApplicationLoadBalancerProps, IBaseLoadBalancerProps
Syntax (vb)
Public Class ApplicationLoadBalancerProps
Inherits Object
Implements IApplicationLoadBalancerProps, IBaseLoadBalancerProps
Remarks
ExampleMetadata: infused
Examples
Cluster cluster;
TaskDefinition taskDefinition;
Vpc vpc;
var service = new FargateService(this, "Service", new FargateServiceProps { Cluster = cluster, TaskDefinition = taskDefinition });
var lb = new ApplicationLoadBalancer(this, "LB", new ApplicationLoadBalancerProps { Vpc = vpc, InternetFacing = true });
var listener = lb.AddListener("Listener", new BaseApplicationListenerProps { Port = 80 });
service.RegisterLoadBalancerTargets(new EcsTarget {
ContainerName = "web",
ContainerPort = 80,
NewTargetGroupId = "ECS",
Listener = ListenerConfig.ApplicationListener(listener, new AddApplicationTargetsProps {
Protocol = ApplicationProtocol.HTTPS
})
});
Synopsis
Constructors
ApplicationLoadBalancerProps() |
Properties
DeletionProtection | Indicates whether deletion protection is enabled. |
Http2Enabled | Indicates whether HTTP/2 is enabled. |
IdleTimeout | The load balancer idle timeout, in seconds. |
InternetFacing | Whether the load balancer has an internet-routable address. |
IpAddressType | The type of IP addresses to use. |
LoadBalancerName | Name of the load balancer. |
SecurityGroup | Security group to associate with this load balancer. |
Vpc | The VPC network to place the load balancer in. |
VpcSubnets | Which subnets place the load balancer in. |
Constructors
ApplicationLoadBalancerProps()
public ApplicationLoadBalancerProps()
Properties
DeletionProtection
Indicates whether deletion protection is enabled.
public Nullable<bool> DeletionProtection { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
Http2Enabled
Indicates whether HTTP/2 is enabled.
public Nullable<bool> Http2Enabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
IdleTimeout
The load balancer idle timeout, in seconds.
public Duration IdleTimeout { get; set; }
Property Value
Remarks
Default: 60
InternetFacing
Whether the load balancer has an internet-routable address.
public Nullable<bool> InternetFacing { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
IpAddressType
The type of IP addresses to use.
public Nullable<IpAddressType> IpAddressType { get; set; }
Property Value
System.Nullable<IpAddressType>
Remarks
Only applies to application load balancers.
Default: IpAddressType.Ipv4
LoadBalancerName
Name of the load balancer.
public string LoadBalancerName { get; set; }
Property Value
System.String
Remarks
Default: - Automatically generated name.
SecurityGroup
Security group to associate with this load balancer.
public ISecurityGroup SecurityGroup { get; set; }
Property Value
Remarks
Default: A security group is created
Vpc
VpcSubnets
Which subnets place the load balancer in.
public ISubnetSelection VpcSubnets { get; set; }
Property Value
Remarks
Default: - the Vpc default strategy.