Skip to content

DeploymentLifecycleHook

Source code in docs_src/capo_ecs/types/deployment_lifecycle_hook.py
class DeploymentLifecycleHook(TypedDict, closed=True):
    target_type: NotRequired[
        "capo_ecs.types.deployment_lifecycle_hook_target_type.DeploymentLifecycleHookTargetType"
    ]
    """<p>The type of action the lifecycle hook performs. Valid values are:</p> <ul> <li> <p> <code>AWS_LAMBDA</code> - Invokes a Lambda function at the specified lifecycle stage. This is the default value.</p> </li> <li> <p> <code>PAUSE</code> - Pauses the deployment at the specified lifecycle stage until you call <code>ContinueServiceDeployment</code> to continue or roll back.</p> </li> </ul> <p>This field is optional. If not specified, the default value is <code>AWS_LAMBDA</code>.</p>"""
    hook_target_arn: NotRequired["capo_ecs.types.string.String"]
    """<p>The Amazon Resource Name (ARN) of the hook target. For <code>AWS_LAMBDA</code> hooks, this is the Lambda function ARN. This field is not applicable for <code>PAUSE</code> hooks.</p> <p>You must provide this parameter when configuring an <code>AWS_LAMBDA</code> lifecycle hook.</p>"""
    role_arn: NotRequired["capo_ecs.types.iam_role_arn.IAMRoleArn"]
    """<p>The Amazon Resource Name (ARN) of the IAM role that grants Amazon ECS permission to call Lambda functions on your behalf.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/blue-green-permissions.html">Permissions required for Lambda functions in Amazon ECS blue/green deployments</a> in the <i> Amazon Elastic Container Service Developer Guide</i>.</p>"""
    lifecycle_stages: NotRequired[
        "capo_ecs.types.deployment_lifecycle_hook_stage_list.DeploymentLifecycleHookStageList"
    ]
    """<p>The lifecycle stages at which to run the hook. Choose from these valid values:</p> <ul> <li> <p>RECONCILE_SERVICE</p> <p>The reconciliation stage that only happens when you start a new service deployment with more than 1 service revision in an ACTIVE state.</p> <p>You can use a lifecycle hook for this stage.</p> </li> <li> <p>PRE_SCALE_UP</p> <p>The green service revision has not started. The blue service revision is handling 100% of the production traffic. There is no test traffic.</p> <p>You can use a lifecycle hook for this stage.</p> </li> <li> <p>POST_SCALE_UP</p> <p>The green service revision has started. The blue service revision is handling 100% of the production traffic. There is no test traffic.</p> <p>You can use a lifecycle hook for this stage.</p> </li> <li> <p>TEST_TRAFFIC_SHIFT</p> <p>The blue and green service revisions are running. The blue service revision handles 100% of the production traffic. The green service revision is migrating from 0% to 100% of test traffic.</p> <p>You can use a lifecycle hook for this stage.</p> </li> <li> <p>POST_TEST_TRAFFIC_SHIFT</p> <p>The test traffic shift is complete. The green service revision handles 100% of the test traffic.</p> <p>You can use a lifecycle hook for this stage.</p> </li> <li> <p>PRE_PRODUCTION_TRAFFIC_SHIFT</p> <p>Occurs before production traffic shift. For linear and canary deployments, this stage is invoked before every traffic shift step.</p> <p>You can use a lifecycle hook for this stage.</p> </li> <li> <p>PRODUCTION_TRAFFIC_SHIFT</p> <p>Production traffic is shifting to the green service revision. The green service revision is migrating from 0% to 100% of production traffic. For linear and canary deployments, this stage is invoked at every traffic shift step.</p> <p>You can use a lifecycle hook for this stage.</p> </li> <li> <p>POST_PRODUCTION_TRAFFIC_SHIFT</p> <p>The production traffic shift is complete.</p> <p>You can use a lifecycle hook for this stage.</p> </li> </ul> <note> <p> <code>PAUSE</code> hooks cannot be configured at <code>TEST_TRAFFIC_SHIFT</code> or <code>PRODUCTION_TRAFFIC_SHIFT</code> stages. These stages are only valid for <code>AWS_LAMBDA</code> hooks.</p> </note> <p>You must provide this parameter when configuring a deployment lifecycle hook.</p>"""
    hook_details: NotRequired["capo_ecs.types.hook_details.HookDetails"]
    """<p>Use this field to specify custom parameters that Amazon ECS passes to your Lambda function on each invocation. This field is not used for <code>PAUSE</code> hooks.</p>"""
    timeout_configuration: NotRequired[
        "capo_ecs.types.deployment_lifecycle_hook_timeout_configuration.DeploymentLifecycleHookTimeoutConfiguration"
    ]
    """<p>The timeout configuration for the lifecycle hook. This specifies how long Amazon ECS waits before taking the timeout action if the hook is not resolved.</p>"""

hook_details instance-attribute

hook_details: NotRequired[HookDetails]

Use this field to specify custom parameters that Amazon ECS passes to your Lambda function on each invocation. This field is not used for PAUSE hooks.

hook_target_arn instance-attribute

hook_target_arn: NotRequired[String]

The Amazon Resource Name (ARN) of the hook target. For AWS_LAMBDA hooks, this is the Lambda function ARN. This field is not applicable for PAUSE hooks.

You must provide this parameter when configuring an AWS_LAMBDA lifecycle hook.

lifecycle_stages instance-attribute

lifecycle_stages: NotRequired[DeploymentLifecycleHookStageList]

The lifecycle stages at which to run the hook. Choose from these valid values:

  • RECONCILE_SERVICE

    The reconciliation stage that only happens when you start a new service deployment with more than 1 service revision in an ACTIVE state.

    You can use a lifecycle hook for this stage.

  • PRE_SCALE_UP

    The green service revision has not started. The blue service revision is handling 100% of the production traffic. There is no test traffic.

    You can use a lifecycle hook for this stage.

  • POST_SCALE_UP

    The green service revision has started. The blue service revision is handling 100% of the production traffic. There is no test traffic.

    You can use a lifecycle hook for this stage.

  • TEST_TRAFFIC_SHIFT

    The blue and green service revisions are running. The blue service revision handles 100% of the production traffic. The green service revision is migrating from 0% to 100% of test traffic.

    You can use a lifecycle hook for this stage.

  • POST_TEST_TRAFFIC_SHIFT

    The test traffic shift is complete. The green service revision handles 100% of the test traffic.

    You can use a lifecycle hook for this stage.

  • PRE_PRODUCTION_TRAFFIC_SHIFT

    Occurs before production traffic shift. For linear and canary deployments, this stage is invoked before every traffic shift step.

    You can use a lifecycle hook for this stage.

  • PRODUCTION_TRAFFIC_SHIFT

    Production traffic is shifting to the green service revision. The green service revision is migrating from 0% to 100% of production traffic. For linear and canary deployments, this stage is invoked at every traffic shift step.

    You can use a lifecycle hook for this stage.

  • POST_PRODUCTION_TRAFFIC_SHIFT

    The production traffic shift is complete.

    You can use a lifecycle hook for this stage.

PAUSE hooks cannot be configured at TEST_TRAFFIC_SHIFT or PRODUCTION_TRAFFIC_SHIFT stages. These stages are only valid for AWS_LAMBDA hooks.

You must provide this parameter when configuring a deployment lifecycle hook.

role_arn instance-attribute

role_arn: NotRequired[IAMRoleArn]

The Amazon Resource Name (ARN) of the IAM role that grants Amazon ECS permission to call Lambda functions on your behalf.

For more information, see Permissions required for Lambda functions in Amazon ECS blue/green deployments in the Amazon Elastic Container Service Developer Guide.

target_type instance-attribute

target_type: NotRequired[DeploymentLifecycleHookTargetType]

The type of action the lifecycle hook performs. Valid values are:

  • AWS_LAMBDA - Invokes a Lambda function at the specified lifecycle stage. This is the default value.

  • PAUSE - Pauses the deployment at the specified lifecycle stage until you call ContinueServiceDeployment to continue or roll back.

This field is optional. If not specified, the default value is AWS_LAMBDA.

timeout_configuration instance-attribute

timeout_configuration: NotRequired[DeploymentLifecycleHookTimeoutConfiguration]

The timeout configuration for the lifecycle hook. This specifies how long Amazon ECS waits before taking the timeout action if the hook is not resolved.