Removes the association of a resource-based policy from an app monitor.
Parameters:
-
name
(AppMonitorName)
–
The app monitor that you want to remove the resource policy from.
-
policy_revision_id
(Optional[PolicyRevisionId], default:
None
)
–
Specifies a specific policy revision to delete. Provide a PolicyRevisionId to ensure an atomic delete operation. If the revision ID that you provide doesn't match the latest policy revision ID, the request will be rejected with an InvalidPolicyRevisionIdException error.
Raises:
Source code in docs_src/capo_rum/_services/rum.py
| def delete_resource_policy(
self,
name: "capo_rum.types.app_monitor_name.AppMonitorName",
*,
config_overrides: Optional[RUMClientConfig] = None,
policy_revision_id: Optional[
"capo_rum.types.policy_revision_id.PolicyRevisionId"
] = None,
) -> "capo_rum.types.delete_resource_policy_response.DeleteResourcePolicyResponse":
"""<p>Removes the association of a resource-based policy from an app monitor.</p>
Args:
name: <p>The app monitor that you want to remove the resource policy from.</p>
policy_revision_id: <p>Specifies a specific policy revision to delete. Provide a <code>PolicyRevisionId</code> to ensure an atomic delete operation. If the revision ID that you provide doesn't match the latest policy revision ID, the request will be rejected with an <code>InvalidPolicyRevisionIdException</code> error.</p>
Raises:
capo_rum.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</p>
capo_rum.errors.conflict_exception.ConflictException: <p>This operation attempted to create a resource that already exists.</p>
capo_rum.errors.internal_server_exception.InternalServerException: <p>Internal service exception.</p>
capo_rum.errors.invalid_policy_revision_id_exception.InvalidPolicyRevisionIdException: <p>The policy revision ID that you provided doeesn't match the latest policy revision ID.</p>
capo_rum.errors.policy_not_found_exception.PolicyNotFoundException: <p>The resource-based policy doesn't exist on this app monitor.</p>
capo_rum.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource not found.</p>
capo_rum.errors.throttling_exception.ThrottlingException: <p>The request was throttled because of quota limits.</p>
capo_rum.errors.validation_exception.ValidationException: <p>One of the arguments for the request is not valid.</p>
capo_rum.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_rum.types.delete_resource_policy_request.DeleteResourcePolicyRequest]",
) -> OperationResponse[
"capo_rum.types.delete_resource_policy_response.DeleteResourcePolicyResponse"
]:
import capo_rum._operations.rum.delete_resource_policy
output, http_response = (
capo_rum._operations.rum.delete_resource_policy.delete_resource_policy(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteResourcePolicy")
)
input_: capo_rum.types.delete_resource_policy_request.DeleteResourcePolicyRequest = {
"name": name
}
if policy_revision_id is not None:
input_["policy_revision_id"] = policy_revision_id
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|