Skip to content

update_action_target async

update_action_target(
    action_target_arn: NonEmptyString,
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    name: Optional[NonEmptyString] = None,
    description: Optional[NonEmptyString] = None,
) -> UpdateActionTargetResponse

Updates the name and description of a custom action target in Security Hub CSPM.

Parameters:

  • action_target_arn (NonEmptyString) –

    The ARN of the custom action target to update.

  • name (Optional[NonEmptyString], default: None ) –

    The updated name of the custom action target.

  • description (Optional[NonEmptyString], default: None ) –

    The updated description for the custom action target.

Raises:

Examples:

To update the name and description of a custom action target The following example updates the name and description of a custom action target in Security Hub. You can create custom actions to automatically respond to Security Hub findings using Amazon EventBridge.

>>> await client.update_action_target(action_target_arn='arn:aws:securityhub:us-west-1:123456789012:action/custom/Remediation', name='Chat custom action', description='Sends specified findings to customer service chat')
Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def update_action_target(
    self,
    action_target_arn: "capo_securityhub.types.non_empty_string.NonEmptyString",
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    name: Optional["capo_securityhub.types.non_empty_string.NonEmptyString"] = None,
    description: Optional[
        "capo_securityhub.types.non_empty_string.NonEmptyString"
    ] = None,
) -> "capo_securityhub.types.update_action_target_response.UpdateActionTargetResponse":
    """<p>Updates the name and description of a custom action target in Security Hub CSPM.</p>

    Args:
        action_target_arn: <p>The ARN of the custom action target to update.</p>
        name: <p>The updated name of the custom action target.</p>
        description: <p>The updated description for the custom action target.</p>

    Raises:
        capo_securityhub.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_securityhub.errors.invalid_access_exception.InvalidAccessException: <p>The account doesn't have permission to perform this action.</p>
        capo_securityhub.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because you supplied an invalid or out-of-range value for an input parameter.</p>
        capo_securityhub.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was rejected because we can't find the specified resource.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To update the name and description of a custom action target
        The following example updates the name and description of a custom action target in Security Hub. You can create custom actions to automatically respond to Security Hub findings using Amazon EventBridge.

        >>> await client.update_action_target(action_target_arn='arn:aws:securityhub:us-west-1:123456789012:action/custom/Remediation', name='Chat custom action', description='Sends specified findings to customer service chat')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.update_action_target_request.UpdateActionTargetRequest]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.update_action_target_response.UpdateActionTargetResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.update_action_target

        (
            output,
            http_response,
        ) = await capo_securityhub._operations.security_hub_api_service.update_action_target.async_update_action_target(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateActionTarget")
    )
    input_: capo_securityhub.types.update_action_target_request.UpdateActionTargetRequest = {
        "action_target_arn": action_target_arn
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output