Skip to content

signal_resource

signal_resource(
    *,
    config_overrides: Optional[CloudFormationClientConfig] = None,
    stack_name: Optional[StackNameOrId] = None,
    logical_resource_id: Optional[LogicalResourceId] = None,
    unique_id: Optional[ResourceSignalUniqueId] = None,
    status: Optional[ResourceSignalStatus] = None,
) -> None

Sends a signal to the specified resource with a success or failure status. You can use the SignalResource operation in conjunction with a creation policy or update policy. CloudFormation doesn't proceed with a stack creation or update until resources receive the required number of signals or the timeout period is exceeded. The SignalResource operation is useful in cases where you want to send signals from anywhere other than an Amazon EC2 instance.

Parameters:

  • stack_name (Optional[StackNameOrId], default: None ) –

    The stack name or unique stack ID that includes the resource that you want to signal.

  • logical_resource_id (Optional[LogicalResourceId], default: None ) –

    The logical ID of the resource that you want to signal. The logical ID is the name of the resource that given in the template.

  • unique_id (Optional[ResourceSignalUniqueId], default: None ) –

    A unique ID of the signal. When you signal Amazon EC2 instances or Auto Scaling groups, specify the instance ID that you are signaling as the unique ID. If you send multiple signals to a single resource (such as signaling a wait condition), each signal requires a different unique ID.

  • status (Optional[ResourceSignalStatus], default: None ) –

    The status of the signal, which is either success or failure. A failure signal causes CloudFormation to immediately fail the stack creation or update.

Raises:

Source code in docs_src/capo_cloudformation/_services/cloud_formation.py
def signal_resource(
    self,
    *,
    config_overrides: Optional[CloudFormationClientConfig] = None,
    stack_name: Optional[
        "capo_cloudformation.types.stack_name_or_id.StackNameOrId"
    ] = None,
    logical_resource_id: Optional[
        "capo_cloudformation.types.logical_resource_id.LogicalResourceId"
    ] = None,
    unique_id: Optional[
        "capo_cloudformation.types.resource_signal_unique_id.ResourceSignalUniqueId"
    ] = None,
    status: Optional[
        "capo_cloudformation.types.resource_signal_status.ResourceSignalStatus"
    ] = None,
) -> None:
    """<p>Sends a signal to the specified resource with a success or failure status. You can use the <code>SignalResource</code> operation in conjunction with a creation policy or update policy. CloudFormation doesn't proceed with a stack creation or update until resources receive the required number of signals or the timeout period is exceeded. The <code>SignalResource</code> operation is useful in cases where you want to send signals from anywhere other than an Amazon EC2 instance.</p>

    Args:
        stack_name: <p>The stack name or unique stack ID that includes the resource that you want to signal.</p>
        logical_resource_id: <p>The logical ID of the resource that you want to signal. The logical ID is the name of the resource that given in the template.</p>
        unique_id: <p>A unique ID of the signal. When you signal Amazon EC2 instances or Auto Scaling groups, specify the instance ID that you are signaling as the unique ID. If you send multiple signals to a single resource (such as signaling a wait condition), each signal requires a different unique ID.</p>
        status: <p>The status of the signal, which is either success or failure. A failure signal causes CloudFormation to immediately fail the stack creation or update.</p>

    Raises:
        capo_cloudformation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudformation.types.signal_resource_input.SignalResourceInput]",
    ) -> OperationResponse[None]:
        import capo_cloudformation._operations.cloud_formation.signal_resource

        output, http_response = (
            capo_cloudformation._operations.cloud_formation.signal_resource.signal_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SignalResource")
    )
    input_: capo_cloudformation.types.signal_resource_input.SignalResourceInput = {}
    if stack_name is not None:
        input_["stack_name"] = stack_name
    if logical_resource_id is not None:
        input_["logical_resource_id"] = logical_resource_id
    if unique_id is not None:
        input_["unique_id"] = unique_id
    if status is not None:
        input_["status"] = status

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output