Class DeploymentLifecycleLambdaTarget
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ecs.DeploymentLifecycleLambdaTarget
- All Implemented Interfaces:
IDeploymentLifecycleHookTarget
,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.113.0 (build fc68b25)",
date="2025-08-20T12:34:42.364Z")
@Stability(Stable)
public class DeploymentLifecycleLambdaTarget
extends software.amazon.jsii.JsiiObject
implements IDeploymentLifecycleHookTarget
Use an AWS Lambda function as a deployment lifecycle hook target.
Example:
import software.amazon.awscdk.services.lambda.*; Cluster cluster; TaskDefinition taskDefinition; Function lambdaHook; ApplicationTargetGroup blueTargetGroup; ApplicationTargetGroup greenTargetGroup; ApplicationListenerRule prodListenerRule; FargateService service = FargateService.Builder.create(this, "Service") .cluster(cluster) .taskDefinition(taskDefinition) .deploymentStrategy(DeploymentStrategy.BLUE_GREEN) .build(); service.addLifecycleHook(DeploymentLifecycleLambdaTarget.Builder.create(lambdaHook, "PreScaleHook") .lifecycleStages(List.of(DeploymentLifecycleStage.PRE_SCALE_UP)) .build()); IEcsLoadBalancerTarget target = service.loadBalancerTarget(LoadBalancerTargetOptions.builder() .containerName("nginx") .containerPort(80) .protocol(Protocol.TCP) .alternateTarget(AlternateTarget.Builder.create("AlternateTarget") .alternateTargetGroup(greenTargetGroup) .productionListener(ListenerRuleConfiguration.applicationListenerRule(prodListenerRule)) .build()) .build()); target.attachToApplicationTargetGroup(blueTargetGroup);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
A fluent builder forDeploymentLifecycleLambdaTarget
.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.ecs.IDeploymentLifecycleHookTarget
IDeploymentLifecycleHookTarget.Jsii$Default, IDeploymentLifecycleHookTarget.Jsii$Proxy
-
Constructor Summary
ConstructorsModifierConstructorDescriptionDeploymentLifecycleLambdaTarget
(IFunction handler, String id, DeploymentLifecycleLambdaTargetProps props) protected
DeploymentLifecycleLambdaTarget
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
DeploymentLifecycleLambdaTarget
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
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
-
DeploymentLifecycleLambdaTarget
protected DeploymentLifecycleLambdaTarget(software.amazon.jsii.JsiiObjectRef objRef) -
DeploymentLifecycleLambdaTarget
protected DeploymentLifecycleLambdaTarget(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
DeploymentLifecycleLambdaTarget
@Stability(Stable) public DeploymentLifecycleLambdaTarget(@NotNull IFunction handler, @NotNull String id, @NotNull DeploymentLifecycleLambdaTargetProps props) - Parameters:
handler
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
bind
@Stability(Stable) @NotNull public DeploymentLifecycleHookTargetConfig bind(@NotNull software.constructs.IConstruct scope) Bind this target to a deployment lifecycle hook.- Specified by:
bind
in interfaceIDeploymentLifecycleHookTarget
- Parameters:
scope
- This parameter is required.
-
getRole
The IAM role for the deployment lifecycle hook target.
-