Class LambdaTarget
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.elasticloadbalancingv2.targets.LambdaTarget
- All Implemented Interfaces:
IApplicationLoadBalancerTarget
,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-22T02:24:01.763Z")
@Stability(Stable)
public class LambdaTarget
extends software.amazon.jsii.JsiiObject
implements IApplicationLoadBalancerTarget
Example:
import software.amazon.awscdk.services.lambda.*; import software.amazon.awscdk.services.elasticloadbalancingv2.targets.*; Function lambdaFunction; ApplicationLoadBalancer lb; ApplicationListener listener = lb.addListener("Listener", BaseApplicationListenerProps.builder().port(80).build()); listener.addTargets("Targets", AddApplicationTargetsProps.builder() .targets(List.of(new LambdaTarget(lambdaFunction))) // For Lambda Targets, you need to explicitly enable health checks if you // want them. .healthCheck(HealthCheck.builder() .enabled(true) .build()) .build());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.IApplicationLoadBalancerTarget
IApplicationLoadBalancerTarget.Jsii$Default, IApplicationLoadBalancerTarget.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionCreate a new Lambda target.protected
LambdaTarget
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
LambdaTarget
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionattachToApplicationTargetGroup
(IApplicationTargetGroup targetGroup) Register this instance target with a load balancer.attachToNetworkTargetGroup
(INetworkTargetGroup targetGroup) Register this instance target with a load balancer.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
LambdaTarget
protected LambdaTarget(software.amazon.jsii.JsiiObjectRef objRef) -
LambdaTarget
protected LambdaTarget(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
LambdaTarget
Create a new Lambda target.- Parameters:
fn
- This parameter is required.
-
-
Method Details
-
attachToApplicationTargetGroup
@Stability(Stable) @NotNull public LoadBalancerTargetProps attachToApplicationTargetGroup(@NotNull IApplicationTargetGroup targetGroup) Register this instance target with a load balancer.Don't call this, it is called automatically when you add the target to a load balancer.
- Specified by:
attachToApplicationTargetGroup
in interfaceIApplicationLoadBalancerTarget
- Parameters:
targetGroup
- This parameter is required.
-
attachToNetworkTargetGroup
@Stability(Stable) @NotNull public LoadBalancerTargetProps attachToNetworkTargetGroup(@NotNull INetworkTargetGroup targetGroup) Register this instance target with a load balancer.Don't call this, it is called automatically when you add the target to a load balancer.
- Parameters:
targetGroup
- This parameter is required.
-