Retrieves detailed information and remediation guidance for a Hook invocation result.
If the Hook uses a KMS key to encrypt annotations, callers of the GetHookResult operation must have kms:Decrypt permissions. For more information, see KMS key policy and permissions for encrypting CloudFormation Hooks results at rest in the CloudFormation Hooks User Guide.
Parameters:
-
hook_result_id
(Optional[HookInvocationId], default:
None
)
–
The unique identifier (ID) of the Hook invocation result that you want details about. You can get the ID from the ListHookResults operation.
Raises:
Source code in docs_src/capo_cloudformation/_services/cloud_formation.py
| def get_hook_result(
self,
*,
config_overrides: Optional[CloudFormationClientConfig] = None,
hook_result_id: Optional[
"capo_cloudformation.types.hook_invocation_id.HookInvocationId"
] = None,
) -> "capo_cloudformation.types.get_hook_result_output.GetHookResultOutput":
"""<p>Retrieves detailed information and remediation guidance for a Hook invocation result.</p> <p>If the Hook uses a KMS key to encrypt annotations, callers of the <code>GetHookResult</code> operation must have <code>kms:Decrypt</code> permissions. For more information, see <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/hooks-userguide/hooks-kms-key-policy.html">KMS key policy and permissions for encrypting CloudFormation Hooks results at rest</a> in the <i>CloudFormation Hooks User Guide</i>.</p>
Args:
hook_result_id: <p>The unique identifier (ID) of the Hook invocation result that you want details about. You can get the ID from the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListHookResults.html">ListHookResults</a> operation.</p>
Raises:
capo_cloudformation.errors.hook_result_not_found_exception.HookResultNotFoundException: <p>The specified target doesn't have any requested Hook invocations.</p>
capo_cloudformation.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cloudformation.types.get_hook_result_input.GetHookResultInput]",
) -> OperationResponse[
"capo_cloudformation.types.get_hook_result_output.GetHookResultOutput"
]:
import capo_cloudformation._operations.cloud_formation.get_hook_result
output, http_response = (
capo_cloudformation._operations.cloud_formation.get_hook_result.get_hook_result(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetHookResult")
)
input_: capo_cloudformation.types.get_hook_result_input.GetHookResultInput = {}
if hook_result_id is not None:
input_["hook_result_id"] = hook_result_id
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|