Namespace Amazon.CDK.AWS.ElasticLoadBalancingV2
Amazon Elastic Load Balancing V2 Construct Library
---AWS CDK v1 has reached End-of-Support on 2023-06-01.
This package is no longer being updated, and users should migrate to AWS CDK v2.
For more information on how to migrate, see the Migrating to AWS CDK v2 guide.
The @aws-cdk/aws-elasticloadbalancingv2
package provides constructs for
configuring application and network load balancers.
For more information, see the AWS documentation for Application Load Balancers and Network Load Balancers.
Defining an Application Load Balancer
You define an application load balancer by creating an instance of
ApplicationLoadBalancer
, adding a Listener to the load balancer
and adding Targets to the Listener:
using Amazon.CDK.AWS.AutoScaling;
AutoScalingGroup asg;
Vpc vpc;
// Create the load balancer in a VPC. 'internetFacing' is 'false'
// by default, which creates an internal load balancer.
var lb = new ApplicationLoadBalancer(this, "LB", new ApplicationLoadBalancerProps {
Vpc = vpc,
InternetFacing = true
});
// Add a listener and open up the load balancer's security group
// to the world.
var listener = lb.AddListener("Listener", new BaseApplicationListenerProps {
Port = 80,
// 'open: true' is the default, you can leave it out if you want. Set it
// to 'false' and use `listener.connections` if you want to be selective
// about who can access the load balancer.
Open = true
});
// Create an AutoScaling group and add it as a load balancing
// target to the listener.
listener.AddTargets("ApplicationFleet", new AddApplicationTargetsProps {
Port = 8080,
Targets = new [] { asg }
});
The security groups of the load balancer and the target are automatically updated to allow the network traffic.
One (or more) security groups can be associated with the load balancer; if a security group isn't provided, one will be automatically created.
Vpc vpc;
var securityGroup1 = new SecurityGroup(this, "SecurityGroup1", new SecurityGroupProps { Vpc = vpc });
var lb = new ApplicationLoadBalancer(this, "LB", new ApplicationLoadBalancerProps {
Vpc = vpc,
InternetFacing = true,
SecurityGroup = securityGroup1
});
var securityGroup2 = new SecurityGroup(this, "SecurityGroup2", new SecurityGroupProps { Vpc = vpc });
lb.AddSecurityGroup(securityGroup2);
Conditions
It's possible to route traffic to targets based on conditions in the incoming
HTTP request. For example, the following will route requests to the indicated
AutoScalingGroup only if the requested host in the request is either for
example.com/ok
or example.com/path
:
ApplicationListener listener;
AutoScalingGroup asg;
listener.AddTargets("Example.Com Fleet", new AddApplicationTargetsProps {
Priority = 10,
Conditions = new [] { ListenerCondition.HostHeaders(new [] { "example.com" }), ListenerCondition.PathPatterns(new [] { "/ok", "/path" }) },
Port = 8080,
Targets = new [] { asg }
});
A target with a condition contains either pathPatterns
or hostHeader
, or
both. If both are specified, both conditions must be met for the requests to
be routed to the given target. priority
is a required field when you add
targets with conditions. The lowest number wins.
Every listener must have at least one target without conditions, which is where all requests that didn't match any of the conditions will be sent.
Convenience methods and more complex Actions
Routing traffic from a Load Balancer to a Target involves the following steps:
A new listener can be added to the Load Balancer by calling addListener()
.
Listeners that have been added to the load balancer can be listed using the
listeners
property. Note that the listeners
property will throw an Error
for imported or looked up Load Balancers.
Various methods on the Listener
take care of this work for you to a greater
or lesser extent:
Using addAction()
gives you access to some of the features of an Elastic Load
Balancer that the other two convenience methods don't:
Here's an example of serving a fixed response at the /ok
URL:
ApplicationListener listener;
listener.AddAction("Fixed", new AddApplicationActionProps {
Priority = 10,
Conditions = new [] { ListenerCondition.PathPatterns(new [] { "/ok" }) },
Action = ListenerAction.FixedResponse(200, new FixedResponseOptions {
ContentType = ContentType.TEXT_PLAIN,
MessageBody = "OK"
})
});
Here's an example of using OIDC authentication before forwarding to a TargetGroup:
ApplicationListener listener;
ApplicationTargetGroup myTargetGroup;
listener.AddAction("DefaultAction", new AddApplicationActionProps {
Action = ListenerAction.AuthenticateOidc(new AuthenticateOidcOptions {
AuthorizationEndpoint = "https://example.com/openid",
// Other OIDC properties here
ClientId = "...",
ClientSecret = SecretValue.SecretsManager("..."),
Issuer = "...",
TokenEndpoint = "...",
UserInfoEndpoint = "...",
// Next
Next = ListenerAction.Forward(new [] { myTargetGroup })
})
});
If you just want to redirect all incoming traffic on one port to another port, you can use the following code:
ApplicationLoadBalancer lb;
lb.AddRedirect(new ApplicationLoadBalancerRedirectConfig {
SourceProtocol = ApplicationProtocol.HTTPS,
SourcePort = 8443,
TargetProtocol = ApplicationProtocol.HTTP,
TargetPort = 8080
});
If you do not provide any options for this method, it redirects HTTP port 80 to HTTPS port 443.
By default all ingress traffic will be allowed on the source port. If you want to be more selective with your
ingress rules then set open: false
and use the listener's connections
object to selectively grant access to the listener.
Defining a Network Load Balancer
Network Load Balancers are defined in a similar way to Application Load Balancers:
Vpc vpc;
AutoScalingGroup asg;
// Create the load balancer in a VPC. 'internetFacing' is 'false'
// by default, which creates an internal load balancer.
var lb = new NetworkLoadBalancer(this, "LB", new NetworkLoadBalancerProps {
Vpc = vpc,
InternetFacing = true
});
// Add a listener on a particular port.
var listener = lb.AddListener("Listener", new BaseNetworkListenerProps {
Port = 443
});
// Add targets on a particular port.
listener.AddTargets("AppFleet", new AddNetworkTargetsProps {
Port = 443,
Targets = new [] { asg }
});
One thing to keep in mind is that network load balancers do not have security groups, and no automatic security group configuration is done for you. You will have to configure the security groups of the target yourself to allow traffic by clients and/or load balancer instances, depending on your target types. See Target Groups for your Network Load Balancers and Register targets with your Target Group for more information.
Targets and Target Groups
Application and Network Load Balancers organize load balancing targets in Target
Groups. If you add your balancing targets (such as AutoScalingGroups, ECS
services or individual instances) to your listener directly, the appropriate
TargetGroup
will be automatically created for you.
If you need more control over the Target Groups created, create an instance of
ApplicationTargetGroup
or NetworkTargetGroup
, add the members you desire,
and add it to the listener by calling addTargetGroups
instead of addTargets
.
addTargets()
will always return the Target Group it just created for you:
NetworkListener listener;
AutoScalingGroup asg1;
AutoScalingGroup asg2;
var group = listener.AddTargets("AppFleet", new AddNetworkTargetsProps {
Port = 443,
Targets = new [] { asg1 }
});
group.AddTarget(asg2);
Sticky sessions for your Application Load Balancer
By default, an Application Load Balancer routes each request independently to a registered target based on the chosen load-balancing algorithm. However, you can use the sticky session feature (also known as session affinity) to enable the load balancer to bind a user's session to a specific target. This ensures that all requests from the user during the session are sent to the same target. This feature is useful for servers that maintain state information in order to provide a continuous experience to clients. To use sticky sessions, the client must support cookies.
Application Load Balancers support both duration-based cookies (lb_cookie
) and application-based cookies (app_cookie
). The key to managing sticky sessions is determining how long your load balancer should consistently route the user's request to the same target. Sticky sessions are enabled at the target group level. You can use a combination of duration-based stickiness, application-based stickiness, and no stickiness across all of your target groups.
Vpc vpc;
// Target group with duration-based stickiness with load-balancer generated cookie
var tg1 = new ApplicationTargetGroup(this, "TG1", new ApplicationTargetGroupProps {
TargetType = TargetType.INSTANCE,
Port = 80,
StickinessCookieDuration = Duration.Minutes(5),
Vpc = vpc
});
// Target group with application-based stickiness
var tg2 = new ApplicationTargetGroup(this, "TG2", new ApplicationTargetGroupProps {
TargetType = TargetType.INSTANCE,
Port = 80,
StickinessCookieDuration = Duration.Minutes(5),
StickinessCookieName = "MyDeliciousCookie",
Vpc = vpc
});
For more information see: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html#application-based-stickiness
Setting the target group protocol version
By default, Application Load Balancers send requests to targets using HTTP/1.1. You can use the protocol version to send requests to targets using HTTP/2 or gRPC.
Vpc vpc;
var tg = new ApplicationTargetGroup(this, "TG", new ApplicationTargetGroupProps {
TargetType = TargetType.IP,
Port = 50051,
Protocol = ApplicationProtocol.HTTP,
ProtocolVersion = ApplicationProtocolVersion.GRPC,
HealthCheck = new HealthCheck {
Enabled = true,
HealthyGrpcCodes = "0-99"
},
Vpc = vpc
});
Using Lambda Targets
To use a Lambda Function as a target, use the integration class in the
@aws-cdk/aws-elasticloadbalancingv2-targets
package:
using Amazon.CDK.AWS.Lambda;
using Amazon.CDK.AWS.ElasticLoadBalancingV2.Targets;
Function lambdaFunction;
ApplicationLoadBalancer lb;
var listener = lb.AddListener("Listener", new BaseApplicationListenerProps { Port = 80 });
listener.AddTargets("Targets", new AddApplicationTargetsProps {
Targets = new [] { new LambdaTarget(lambdaFunction) },
// For Lambda Targets, you need to explicitly enable health checks if you
// want them.
HealthCheck = new HealthCheck {
Enabled = true
}
});
Only a single Lambda function can be added to a single listener rule.
Using Application Load Balancer Targets
To use a single application load balancer as a target for the network load balancer, use the integration class in the
@aws-cdk/aws-elasticloadbalancingv2-targets
package:
using Amazon.CDK.AWS.ElasticLoadBalancingV2.Targets;
using Amazon.CDK.AWS.ECS;
using Amazon.CDK.AWS.ECS.Patterns;
Vpc vpc;
var task = new FargateTaskDefinition(this, "Task", new FargateTaskDefinitionProps { Cpu = 256, MemoryLimitMiB = 512 });
task.AddContainer("nginx", new ContainerDefinitionOptions {
Image = ContainerImage.FromRegistry("public.ecr.aws/nginx/nginx:latest"),
PortMappings = new [] { new PortMapping { ContainerPort = 80 } }
});
var svc = new ApplicationLoadBalancedFargateService(this, "Service", new ApplicationLoadBalancedFargateServiceProps {
Vpc = vpc,
TaskDefinition = task,
PublicLoadBalancer = false
});
var nlb = new NetworkLoadBalancer(this, "Nlb", new NetworkLoadBalancerProps {
Vpc = vpc,
CrossZoneEnabled = true,
InternetFacing = true
});
var listener = nlb.AddListener("listener", new BaseNetworkListenerProps { Port = 80 });
listener.AddTargets("Targets", new AddNetworkTargetsProps {
Targets = new [] { new AlbTarget(svc.LoadBalancer, 80) },
Port = 80
});
new CfnOutput(this, "NlbEndpoint", new CfnOutputProps { Value = $"http://{nlb.loadBalancerDnsName}" });
Only the network load balancer is allowed to add the application load balancer as the target.
Configuring Health Checks
Health checks are configured upon creation of a target group:
ApplicationListener listener;
AutoScalingGroup asg;
listener.AddTargets("AppFleet", new AddApplicationTargetsProps {
Port = 8080,
Targets = new [] { asg },
HealthCheck = new HealthCheck {
Path = "/ping",
Interval = Duration.Minutes(1)
}
});
The health check can also be configured after creation by calling
configureHealthCheck()
on the created object.
No attempts are made to configure security groups for the port you're configuring a health check for, but if the health check is on the same port you're routing traffic to, the security group already allows the traffic. If not, you will have to configure the security groups appropriately:
ApplicationLoadBalancer lb;
ApplicationListener listener;
AutoScalingGroup asg;
listener.AddTargets("AppFleet", new AddApplicationTargetsProps {
Port = 8080,
Targets = new [] { asg },
HealthCheck = new HealthCheck {
Port = "8088"
}
});
asg.Connections.AllowFrom(lb, Port.Tcp(8088));
Using a Load Balancer from a different Stack
If you want to put your Load Balancer and the Targets it is load balancing to in
different stacks, you may not be able to use the convenience methods
loadBalancer.addListener()
and listener.addTargets()
.
The reason is that these methods will create resources in the same Stack as the
object they're called on, which may lead to cyclic references between stacks.
Instead, you will have to create an ApplicationListener
in the target stack,
or an empty TargetGroup
in the load balancer stack that you attach your
service to.
For an example of the alternatives while load balancing to an ECS service, see the ecs/cross-stack-load-balancer example.
Protocol for Load Balancer Targets
Constructs that want to be a load balancer target should implement
IApplicationLoadBalancerTarget
and/or INetworkLoadBalancerTarget
, and
provide an implementation for the function attachToXxxTargetGroup()
, which can
call functions on the load balancer and should return metadata about the
load balancing target:
class MyTarget : IApplicationLoadBalancerTarget
{
public LoadBalancerTargetProps AttachToApplicationTargetGroup(ApplicationTargetGroup targetGroup)
{
// If we need to add security group rules
// targetGroup.registerConnectable(...);
return new LoadBalancerTargetProps {
TargetType = TargetType.IP,
TargetJson = new Struct { Id = "1.2.3.4", Port = 8080 }
};
}
}
targetType
should be one of Instance
or Ip
. If the target can be
directly added to the target group, targetJson
should contain the id
of
the target (either instance ID or IP address depending on the type) and
optionally a port
or availabilityZone
override.
Application load balancer targets can call registerConnectable()
on the
target group to register themselves for addition to the load balancer's security
group rules.
If your load balancer target requires that the TargetGroup has been
associated with a LoadBalancer before registration can happen (such as is the
case for ECS Services for example), take a resource dependency on
targetGroup.loadBalancerAttached
as follows:
Resource resource;
ApplicationTargetGroup targetGroup;
// Make sure that the listener has been created, and so the TargetGroup
// has been associated with the LoadBalancer, before 'resource' is created.
Node.Of(resource).AddDependency(targetGroup.LoadBalancerAttached);
Looking up Load Balancers and Listeners
You may look up load balancers and load balancer listeners by using one of the following lookup methods:
Load Balancer lookup options
You may look up a load balancer by ARN or by associated tags. When you look a load balancer up by ARN, that load balancer will be returned unless CDK detects that the load balancer is of the wrong type. When you look up a load balancer by tags, CDK will return the load balancer matching all specified tags. If more than one load balancer matches, CDK will throw an error requesting that you provide more specific criteria.
Look up a Application Load Balancer by ARN
var loadBalancer = ApplicationLoadBalancer.FromLookup(this, "ALB", new ApplicationLoadBalancerLookupOptions {
LoadBalancerArn = "arn:aws:elasticloadbalancing:us-east-2:123456789012:loadbalancer/app/my-load-balancer/1234567890123456"
});
Look up an Application Load Balancer by tags
var loadBalancer = ApplicationLoadBalancer.FromLookup(this, "ALB", new ApplicationLoadBalancerLookupOptions {
LoadBalancerTags = new Dictionary<string, string> {
// Finds a load balancer matching all tags.
{ "some", "tag" },
{ "someother", "tag" }
}
});
Load Balancer Listener lookup options
You may look up a load balancer listener by the following criteria:
The lookup method will return the matching listener. If more than one listener matches, CDK will throw an error requesting that you specify additional criteria.
Look up a Listener by associated Load Balancer, Port, and Protocol
var listener = ApplicationListener.FromLookup(this, "ALBListener", new ApplicationListenerLookupOptions {
LoadBalancerArn = "arn:aws:elasticloadbalancing:us-east-2:123456789012:loadbalancer/app/my-load-balancer/1234567890123456",
ListenerProtocol = ApplicationProtocol.HTTPS,
ListenerPort = 443
});
Look up a Listener by associated Load Balancer Tag, Port, and Protocol
var listener = ApplicationListener.FromLookup(this, "ALBListener", new ApplicationListenerLookupOptions {
LoadBalancerTags = new Dictionary<string, string> {
{ "Cluster", "MyClusterName" }
},
ListenerProtocol = ApplicationProtocol.HTTPS,
ListenerPort = 443
});
Look up a Network Listener by associated Load Balancer Tag, Port, and Protocol
var listener = NetworkListener.FromLookup(this, "ALBListener", new NetworkListenerLookupOptions {
LoadBalancerTags = new Dictionary<string, string> {
{ "Cluster", "MyClusterName" }
},
ListenerProtocol = Protocol.TCP,
ListenerPort = 12345
});
Classes
AddApplicationActionProps | Properties for adding a new action to a listener. |
AddApplicationTargetGroupsProps | Properties for adding a new target group to a listener. |
AddApplicationTargetsProps | Properties for adding new targets to a listener. |
AddFixedResponseProps | (deprecated) Properties for adding a fixed response to a listener. |
AddNetworkActionProps | Properties for adding a new action to a listener. |
AddNetworkTargetsProps | Properties for adding new network targets to a listener. |
AddRedirectResponseProps | (deprecated) Properties for adding a redirect response to a listener. |
AddRuleProps | Properties for adding a conditional load balancing rule. |
AlpnPolicy | Application-Layer Protocol Negotiation Policies for network load balancers. |
ApplicationListener | Define an ApplicationListener. |
ApplicationListenerAttributes | Properties to reference an existing listener. |
ApplicationListenerCertificate | Add certificates to a listener. |
ApplicationListenerCertificateProps | Properties for adding a set of certificates to a listener. |
ApplicationListenerLookupOptions | Options for ApplicationListener lookup. |
ApplicationListenerProps | Properties for defining a standalone ApplicationListener. |
ApplicationListenerRule | Define a new listener rule. |
ApplicationListenerRuleProps | Properties for defining a listener rule. |
ApplicationLoadBalancer | Define an Application Load Balancer. |
ApplicationLoadBalancerAttributes | Properties to reference an existing load balancer. |
ApplicationLoadBalancerLookupOptions | Options for looking up an ApplicationLoadBalancer. |
ApplicationLoadBalancerProps | Properties for defining an Application Load Balancer. |
ApplicationLoadBalancerRedirectConfig | Properties for a redirection config. |
ApplicationProtocol | Load balancing protocol for application load balancers. |
ApplicationProtocolVersion | Load balancing protocol version for application load balancers. |
ApplicationTargetGroup | Define an Application Target Group. |
ApplicationTargetGroupProps | Properties for defining an Application Target Group. |
AuthenticateOidcOptions | Options for |
BaseApplicationListenerProps | Basic properties for an ApplicationListener. |
BaseApplicationListenerRuleProps | Basic properties for defining a rule on a listener. |
BaseListener | Base class for listeners. |
BaseListenerLookupOptions | Options for listener lookup. |
BaseLoadBalancer | Base class for both Application and Network Load Balancers. |
BaseLoadBalancerLookupOptions | Options for looking up load balancers. |
BaseLoadBalancerProps | Shared properties of both Application and Network Load Balancers. |
BaseNetworkListenerProps | Basic properties for a Network Listener. |
BaseTargetGroupProps | Basic properties of both Application and Network Target Groups. |
CfnListener | A CloudFormation |
CfnListener.ActionProperty | Specifies an action for a listener rule. |
CfnListener.AuthenticateCognitoConfigProperty | Specifies information required when integrating with Amazon Cognito to authenticate users. |
CfnListener.AuthenticateOidcConfigProperty | Specifies information required using an identity provide (IdP) that is compliant with OpenID Connect (OIDC) to authenticate users. |
CfnListener.CertificateProperty | Specifies an SSL server certificate to use as the default certificate for a secure listener. |
CfnListener.FixedResponseConfigProperty | Specifies information required when returning a custom HTTP response. |
CfnListener.ForwardConfigProperty | Information for creating an action that distributes requests among one or more target groups. |
CfnListener.RedirectConfigProperty | Information about a redirect action. |
CfnListener.TargetGroupStickinessConfigProperty | Information about the target group stickiness for a rule. |
CfnListener.TargetGroupTupleProperty | Information about how traffic will be distributed between multiple target groups in a forward rule. |
CfnListenerCertificate | A CloudFormation |
CfnListenerCertificate.CertificateProperty | Specifies an SSL server certificate for the certificate list of a secure listener. |
CfnListenerCertificateProps | Properties for defining a |
CfnListenerProps | Properties for defining a |
CfnListenerRule | A CloudFormation |
CfnListenerRule.ActionProperty | Specifies an action for a listener rule. |
CfnListenerRule.AuthenticateCognitoConfigProperty | Specifies information required when integrating with Amazon Cognito to authenticate users. |
CfnListenerRule.AuthenticateOidcConfigProperty | Specifies information required using an identity provide (IdP) that is compliant with OpenID Connect (OIDC) to authenticate users. |
CfnListenerRule.FixedResponseConfigProperty | Specifies information required when returning a custom HTTP response. |
CfnListenerRule.ForwardConfigProperty | Information for creating an action that distributes requests among one or more target groups. |
CfnListenerRule.HostHeaderConfigProperty | Information about a host header condition. |
CfnListenerRule.HttpHeaderConfigProperty | Information about an HTTP header condition. |
CfnListenerRule.HttpRequestMethodConfigProperty | Information about an HTTP method condition. |
CfnListenerRule.PathPatternConfigProperty | Information about a path pattern condition. |
CfnListenerRule.QueryStringConfigProperty | Information about a query string condition. |
CfnListenerRule.QueryStringKeyValueProperty | Information about a key/value pair. |
CfnListenerRule.RedirectConfigProperty | Information about a redirect action. |
CfnListenerRule.RuleConditionProperty | Specifies a condition for a listener rule. |
CfnListenerRule.SourceIpConfigProperty | Information about a source IP condition. |
CfnListenerRule.TargetGroupStickinessConfigProperty | Information about the target group stickiness for a rule. |
CfnListenerRule.TargetGroupTupleProperty | Information about how traffic will be distributed between multiple target groups in a forward rule. |
CfnListenerRuleProps | Properties for defining a |
CfnLoadBalancer | A CloudFormation |
CfnLoadBalancer.LoadBalancerAttributeProperty | Specifies an attribute for an Application Load Balancer, a Network Load Balancer, or a Gateway Load Balancer. |
CfnLoadBalancer.SubnetMappingProperty | Specifies a subnet for a load balancer. |
CfnLoadBalancerProps | Properties for defining a |
CfnTargetGroup | A CloudFormation |
CfnTargetGroup.MatcherProperty | Specifies the HTTP codes that healthy targets must use when responding to an HTTP health check. |
CfnTargetGroup.TargetDescriptionProperty | Specifies a target to add to a target group. |
CfnTargetGroup.TargetGroupAttributeProperty | Specifies a target group attribute. |
CfnTargetGroupProps | Properties for defining a |
ContentType | (deprecated) The content type for a fixed response. |
FixedResponse | (deprecated) A fixed response. |
FixedResponseOptions | Options for |
ForwardOptions | Options for |
HealthCheck | Properties for configuring a health check. |
HttpCodeElb | Count of HTTP status originating from the load balancer. |
HttpCodeTarget | Count of HTTP status originating from the targets. |
InstanceTarget | (deprecated) An EC2 instance that is the target for load balancing. |
IpAddressType | What kind of addresses to allocate to the load balancer. |
IpTarget | (deprecated) An IP address that is a target for load balancing. |
ListenerAction | What to do when a client makes a request to a listener. |
ListenerCertificate | A certificate source for an ELBv2 listener. |
ListenerCondition | ListenerCondition providers definition. |
LoadBalancerTargetProps | Result of attaching a target to load balancer. |
NetworkForwardOptions | Options for |
NetworkListener | Define a Network Listener. |
NetworkListenerAction | What to do when a client makes a request to a listener. |
NetworkListenerLookupOptions | Options for looking up a network listener. |
NetworkListenerProps | Properties for a Network Listener attached to a Load Balancer. |
NetworkLoadBalancer | Define a new network load balancer. |
NetworkLoadBalancerAttributes | Properties to reference an existing load balancer. |
NetworkLoadBalancerLookupOptions | Options for looking up an NetworkLoadBalancer. |
NetworkLoadBalancerProps | Properties for a network load balancer. |
NetworkTargetGroup | Define a Network Target Group. |
NetworkTargetGroupProps | Properties for a new Network Target Group. |
NetworkWeightedTargetGroup | A Target Group and weight combination. |
Protocol | Backend protocol for network load balancers and health checks. |
QueryStringCondition | Properties for the key/value pair of the query string. |
RedirectOptions | Options for |
RedirectResponse | (deprecated) A redirect response. |
SslPolicy | Elastic Load Balancing provides the following security policies for Application Load Balancers. |
TargetGroupAttributes | Properties to reference an existing target group. |
TargetGroupBase | Define the target of a load balancer. |
TargetGroupImportProps | (deprecated) Properties to reference an existing target group. |
TargetGroupLoadBalancingAlgorithmType | Load balancing algorithmm type for target groups. |
TargetType | How to interpret the load balancing target identifiers. |
UnauthenticatedAction | What to do with unauthenticated requests. |
WeightedTargetGroup | A Target Group and weight combination. |
Interfaces
CfnListener.IActionProperty | Specifies an action for a listener rule. |
CfnListener.IAuthenticateCognitoConfigProperty | Specifies information required when integrating with Amazon Cognito to authenticate users. |
CfnListener.IAuthenticateOidcConfigProperty | Specifies information required using an identity provide (IdP) that is compliant with OpenID Connect (OIDC) to authenticate users. |
CfnListener.ICertificateProperty | Specifies an SSL server certificate to use as the default certificate for a secure listener. |
CfnListener.IFixedResponseConfigProperty | Specifies information required when returning a custom HTTP response. |
CfnListener.IForwardConfigProperty | Information for creating an action that distributes requests among one or more target groups. |
CfnListener.IRedirectConfigProperty | Information about a redirect action. |
CfnListener.ITargetGroupStickinessConfigProperty | Information about the target group stickiness for a rule. |
CfnListener.ITargetGroupTupleProperty | Information about how traffic will be distributed between multiple target groups in a forward rule. |
CfnListenerCertificate.ICertificateProperty | Specifies an SSL server certificate for the certificate list of a secure listener. |
CfnListenerRule.IActionProperty | Specifies an action for a listener rule. |
CfnListenerRule.IAuthenticateCognitoConfigProperty | Specifies information required when integrating with Amazon Cognito to authenticate users. |
CfnListenerRule.IAuthenticateOidcConfigProperty | Specifies information required using an identity provide (IdP) that is compliant with OpenID Connect (OIDC) to authenticate users. |
CfnListenerRule.IFixedResponseConfigProperty | Specifies information required when returning a custom HTTP response. |
CfnListenerRule.IForwardConfigProperty | Information for creating an action that distributes requests among one or more target groups. |
CfnListenerRule.IHostHeaderConfigProperty | Information about a host header condition. |
CfnListenerRule.IHttpHeaderConfigProperty | Information about an HTTP header condition. |
CfnListenerRule.IHttpRequestMethodConfigProperty | Information about an HTTP method condition. |
CfnListenerRule.IPathPatternConfigProperty | Information about a path pattern condition. |
CfnListenerRule.IQueryStringConfigProperty | Information about a query string condition. |
CfnListenerRule.IQueryStringKeyValueProperty | Information about a key/value pair. |
CfnListenerRule.IRedirectConfigProperty | Information about a redirect action. |
CfnListenerRule.IRuleConditionProperty | Specifies a condition for a listener rule. |
CfnListenerRule.ISourceIpConfigProperty | Information about a source IP condition. |
CfnListenerRule.ITargetGroupStickinessConfigProperty | Information about the target group stickiness for a rule. |
CfnListenerRule.ITargetGroupTupleProperty | Information about how traffic will be distributed between multiple target groups in a forward rule. |
CfnLoadBalancer.ILoadBalancerAttributeProperty | Specifies an attribute for an Application Load Balancer, a Network Load Balancer, or a Gateway Load Balancer. |
CfnLoadBalancer.ISubnetMappingProperty | Specifies a subnet for a load balancer. |
CfnTargetGroup.IMatcherProperty | Specifies the HTTP codes that healthy targets must use when responding to an HTTP health check. |
CfnTargetGroup.ITargetDescriptionProperty | Specifies a target to add to a target group. |
CfnTargetGroup.ITargetGroupAttributeProperty | Specifies a target group attribute. |
IAddApplicationActionProps | Properties for adding a new action to a listener. |
IAddApplicationTargetGroupsProps | Properties for adding a new target group to a listener. |
IAddApplicationTargetsProps | Properties for adding new targets to a listener. |
IAddFixedResponseProps | (deprecated) Properties for adding a fixed response to a listener. |
IAddNetworkActionProps | Properties for adding a new action to a listener. |
IAddNetworkTargetsProps | Properties for adding new network targets to a listener. |
IAddRedirectResponseProps | (deprecated) Properties for adding a redirect response to a listener. |
IAddRuleProps | Properties for adding a conditional load balancing rule. |
IApplicationListener | Properties to reference an existing listener. |
IApplicationListenerAttributes | Properties to reference an existing listener. |
IApplicationListenerCertificateProps | Properties for adding a set of certificates to a listener. |
IApplicationListenerLookupOptions | Options for ApplicationListener lookup. |
IApplicationListenerProps | Properties for defining a standalone ApplicationListener. |
IApplicationListenerRuleProps | Properties for defining a listener rule. |
IApplicationLoadBalancer | An application load balancer. |
IApplicationLoadBalancerAttributes | Properties to reference an existing load balancer. |
IApplicationLoadBalancerLookupOptions | Options for looking up an ApplicationLoadBalancer. |
IApplicationLoadBalancerProps | Properties for defining an Application Load Balancer. |
IApplicationLoadBalancerRedirectConfig | Properties for a redirection config. |
IApplicationLoadBalancerTarget | Interface for constructs that can be targets of an application load balancer. |
IApplicationTargetGroup | A Target Group for Application Load Balancers. |
IApplicationTargetGroupProps | Properties for defining an Application Target Group. |
IAuthenticateOidcOptions | Options for |
IBaseApplicationListenerProps | Basic properties for an ApplicationListener. |
IBaseApplicationListenerRuleProps | Basic properties for defining a rule on a listener. |
IBaseListenerLookupOptions | Options for listener lookup. |
IBaseLoadBalancerLookupOptions | Options for looking up load balancers. |
IBaseLoadBalancerProps | Shared properties of both Application and Network Load Balancers. |
IBaseNetworkListenerProps | Basic properties for a Network Listener. |
IBaseTargetGroupProps | Basic properties of both Application and Network Target Groups. |
ICfnListenerCertificateProps | Properties for defining a |
ICfnListenerProps | Properties for defining a |
ICfnListenerRuleProps | Properties for defining a |
ICfnLoadBalancerProps | Properties for defining a |
ICfnTargetGroupProps | Properties for defining a |
IFixedResponse | (deprecated) A fixed response. |
IFixedResponseOptions | Options for |
IForwardOptions | Options for |
IHealthCheck | Properties for configuring a health check. |
IListenerAction | Interface for listener actions. |
IListenerCertificate | A certificate source for an ELBv2 listener. |
ILoadBalancerTargetProps | Result of attaching a target to load balancer. |
ILoadBalancerV2 | |
INetworkForwardOptions | Options for |
INetworkListener | Properties to reference an existing listener. |
INetworkListenerCertificateProps | (deprecated) Properties for adding a certificate to a listener. |
INetworkListenerLookupOptions | Options for looking up a network listener. |
INetworkListenerProps | Properties for a Network Listener attached to a Load Balancer. |
INetworkLoadBalancer | A network load balancer. |
INetworkLoadBalancerAttributes | Properties to reference an existing load balancer. |
INetworkLoadBalancerLookupOptions | Options for looking up an NetworkLoadBalancer. |
INetworkLoadBalancerProps | Properties for a network load balancer. |
INetworkLoadBalancerTarget | Interface for constructs that can be targets of an network load balancer. |
INetworkTargetGroup | A network target group. |
INetworkTargetGroupProps | Properties for a new Network Target Group. |
INetworkWeightedTargetGroup | A Target Group and weight combination. |
IQueryStringCondition | Properties for the key/value pair of the query string. |
IRedirectOptions | Options for |
IRedirectResponse | (deprecated) A redirect response. |
ITargetGroup | A target group. |
ITargetGroupAttributes | Properties to reference an existing target group. |
ITargetGroupImportProps | (deprecated) Properties to reference an existing target group. |
IWeightedTargetGroup | A Target Group and weight combination. |