Retrieves the JSON text of the resource-based policy document attached to the CloudTrail event data store, dashboard, or channel.
Parameters:
-
resource_arn
(ResourceArn)
–
The Amazon Resource Name (ARN) of the CloudTrail event data store, dashboard, or channel attached to the resource-based policy.
Example event data store ARN format: arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE
Example dashboard ARN format: arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash
Example channel ARN format: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890
Raises:
-
OperationNotPermittedException
–
This exception is thrown when the requested operation is not permitted.
-
ResourceARNNotValidException
–
This exception is thrown when the provided resource does not exist, or the ARN format of the resource is not valid.
The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE
The following is the format of a dashboard ARN: arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash
The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890
-
ResourceNotFoundException
–
This exception is thrown when the specified resource is not found.
-
ResourcePolicyNotFoundException
–
This exception is thrown when the specified resource policy is not found.
-
ResourceTypeNotSupportedException
–
This exception is thrown when the specified resource type is not supported by CloudTrail.
-
UnsupportedOperationException
–
This exception is thrown when the requested operation is not supported.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_cloudtrail/_services/async_cloud_trail.py
| async def get_resource_policy(
self,
resource_arn: "capo_cloudtrail.types.resource_arn.ResourceArn",
*,
config_overrides: Optional[AsyncCloudTrailClientConfig] = None,
) -> "capo_cloudtrail.types.get_resource_policy_response.GetResourcePolicyResponse":
"""<p> Retrieves the JSON text of the resource-based policy document attached to the CloudTrail event data store, dashboard, or channel. </p>
Args:
resource_arn: <p> The Amazon Resource Name (ARN) of the CloudTrail event data store, dashboard, or channel attached to the resource-based policy.</p> <p>Example event data store ARN format: <code>arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE</code> </p> <p>Example dashboard ARN format: <code>arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash</code> </p> <p>Example channel ARN format: <code>arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890</code> </p>
Raises:
capo_cloudtrail.errors.operation_not_permitted_exception.OperationNotPermittedException: <p>This exception is thrown when the requested operation is not permitted.</p>
capo_cloudtrail.errors.resource_arn_not_valid_exception.ResourceARNNotValidException: <p> This exception is thrown when the provided resource does not exist, or the ARN format of the resource is not valid. </p> <p>The following is the format of an event data store ARN: <code>arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE</code> </p> <p>The following is the format of a dashboard ARN: <code>arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash</code> </p> <p>The following is the format of a channel ARN: <code>arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890</code> </p>
capo_cloudtrail.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when the specified resource is not found.</p>
capo_cloudtrail.errors.resource_policy_not_found_exception.ResourcePolicyNotFoundException: <p> This exception is thrown when the specified resource policy is not found. </p>
capo_cloudtrail.errors.resource_type_not_supported_exception.ResourceTypeNotSupportedException: <p>This exception is thrown when the specified resource type is not supported by CloudTrail.</p>
capo_cloudtrail.errors.unsupported_operation_exception.UnsupportedOperationException: <p>This exception is thrown when the requested operation is not supported.</p>
capo_cloudtrail.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudtrail.types.get_resource_policy_request.GetResourcePolicyRequest]",
) -> AsyncOperationResponse[
"capo_cloudtrail.types.get_resource_policy_response.GetResourcePolicyResponse"
]:
import capo_cloudtrail._operations.cloud_trail_20131101.get_resource_policy
(
output,
http_response,
) = await capo_cloudtrail._operations.cloud_trail_20131101.get_resource_policy.async_get_resource_policy(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetResourcePolicy")
)
input_: capo_cloudtrail.types.get_resource_policy_request.GetResourcePolicyRequest = {
"resource_arn": resource_arn
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|