Deletes a custom action target from Security Hub CSPM.
Deleting a custom action target does not affect any findings or insights that were already sent to Amazon CloudWatch Events using the custom action.
Parameters:
-
action_target_arn
(NonEmptyString)
–
The Amazon Resource Name (ARN) of the custom action target to delete.
Raises:
Examples:
To delete a custom action target
The following example deletes a custom action target that triggers target actions in Amazon CloudWatch Events. Deleting a custom action target doesn't affect findings or insights that were already sent to CloudWatch Events based on the custom action.
>>> await client.delete_action_target(action_target_arn='arn:aws:securityhub:us-west-1:123456789012:action/custom/Remediation')
Source code in docs_src/capo_securityhub/_services/async_security_hub.py
| async def delete_action_target(
self,
action_target_arn: "capo_securityhub.types.non_empty_string.NonEmptyString",
*,
config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
) -> "capo_securityhub.types.delete_action_target_response.DeleteActionTargetResponse":
"""<p>Deletes a custom action target from Security Hub CSPM.</p> <p>Deleting a custom action target does not affect any findings or insights that were already sent to Amazon CloudWatch Events using the custom action.</p>
Args:
action_target_arn: <p>The Amazon Resource Name (ARN) of the custom action target to delete.</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 delete a custom action target
The following example deletes a custom action target that triggers target actions in Amazon CloudWatch Events. Deleting a custom action target doesn't affect findings or insights that were already sent to CloudWatch Events based on the custom action.
>>> await client.delete_action_target(action_target_arn='arn:aws:securityhub:us-west-1:123456789012:action/custom/Remediation')
"""
async def _handler(
req: "AsyncOperationRequest[capo_securityhub.types.delete_action_target_request.DeleteActionTargetRequest]",
) -> AsyncOperationResponse[
"capo_securityhub.types.delete_action_target_response.DeleteActionTargetResponse"
]:
import capo_securityhub._operations.security_hub_api_service.delete_action_target
(
output,
http_response,
) = await capo_securityhub._operations.security_hub_api_service.delete_action_target.async_delete_action_target(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteActionTarget")
)
input_: capo_securityhub.types.delete_action_target_request.DeleteActionTargetRequest = {
"action_target_arn": action_target_arn
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|