Class LambdaTarget
Inheritance
Implements
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2.Targets
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class LambdaTarget : DeputyBase, IApplicationLoadBalancerTarget
Syntax (vb)
Public Class LambdaTarget
Inherits DeputyBase
Implements IApplicationLoadBalancerTarget
Remarks
ExampleMetadata: infused
Examples
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
}
});
Synopsis
Constructors
LambdaTarget(IFunction) | Create a new Lambda target. |
LambdaTarget(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
LambdaTarget(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
AttachToApplicationTargetGroup(IApplicationTargetGroup) | Register this instance target with a load balancer. |
AttachToNetworkTargetGroup(INetworkTargetGroup) | Register this instance target with a load balancer. |
Constructors
LambdaTarget(IFunction)
LambdaTarget(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected LambdaTarget(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
LambdaTarget(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected LambdaTarget(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
AttachToApplicationTargetGroup(IApplicationTargetGroup)
Register this instance target with a load balancer.
public virtual ILoadBalancerTargetProps AttachToApplicationTargetGroup(IApplicationTargetGroup targetGroup)
Parameters
- targetGroup IApplicationTargetGroup
Returns
Remarks
Don't call this, it is called automatically when you add the target to a load balancer.
AttachToNetworkTargetGroup(INetworkTargetGroup)
Register this instance target with a load balancer.
public virtual ILoadBalancerTargetProps AttachToNetworkTargetGroup(INetworkTargetGroup targetGroup)
Parameters
- targetGroup INetworkTargetGroup
Returns
Remarks
Don't call this, it is called automatically when you add the target to a load balancer.