Interface DeploymentLifecycleLambdaTargetProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
DeploymentLifecycleLambdaTargetProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-05T22:26:35.853Z")
@Stability(Stable)
public interface DeploymentLifecycleLambdaTargetProps
extends software.amazon.jsii.JsiiSerializable
Configuration for a lambda deployment lifecycle hook.
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 TypeInterfaceDescriptionstatic final classA builder forDeploymentLifecycleLambdaTargetPropsstatic final classAn implementation forDeploymentLifecycleLambdaTargetProps -
Method Summary
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getLifecycleStages
The lifecycle stages when this hook should be executed. -
getRole
The IAM role that grants permissions to invoke the lambda target.Default: - A unique role will be generated for this lambda function.
-
builder
-