Skip to content

remove_permission

remove_permission(
    queue_url: String,
    label: String,
    *,
    config_overrides: Optional[SQSClientConfig] = None,
) -> None

Revokes any permissions in the queue policy that matches the specified Label parameter.

  • Only the owner of a queue can remove permissions from it.

  • Cross-account permissions don't apply to this action. For more information, see Grant cross-account permissions to a role and a username in the Amazon SQS Developer Guide.

  • To remove the ability to change queue permissions, you must deny permission to the AddPermission, RemovePermission, and SetQueueAttributes actions in your IAM policy.

Parameters:

  • queue_url (String) –

    The URL of the Amazon SQS queue from which permissions are removed.

    Queue URLs and names are case-sensitive.

  • label (String) –

    The identification of the permission to remove. This is the label added using the AddPermission action.

Raises:

  • InvalidAddress –

    The specified ID is invalid.

  • InvalidSecurity –

    The request was not made over HTTPS or did not use SigV4 for signing.

  • QueueDoesNotExist –

    Ensure that the QueueUrl is correct and that the queue has not been deleted.

  • RequestThrottled –

    The request was denied due to request throttling.

    • Exceeds the permitted request rate for the queue or for the recipient of the request.

    • Ensure that the request rate is within the Amazon SQS limits for sending messages. For more information, see Amazon SQS quotas in the Amazon SQS Developer Guide.

  • UnsupportedOperation –

    Error code 400. Unsupported operation.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sqs/_services/sqs.py
def remove_permission(
    self,
    queue_url: "capo_sqs.types.string.String",
    label: "capo_sqs.types.string.String",
    *,
    config_overrides: Optional[SQSClientConfig] = None,
) -> None:
    """<p>Revokes any permissions in the queue policy that matches the specified <code>Label</code> parameter.</p> <note> <ul> <li> <p>Only the owner of a queue can remove permissions from it.</p> </li> <li> <p>Cross-account permissions don't apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant cross-account permissions to a role and a username</a> in the <i>Amazon SQS Developer Guide</i>.</p> </li> <li> <p>To remove the ability to change queue permissions, you must deny permission to the <code>AddPermission</code>, <code>RemovePermission</code>, and <code>SetQueueAttributes</code> actions in your IAM policy.</p> </li> </ul> </note>

    Args:
        queue_url: <p>The URL of the Amazon SQS queue from which permissions are removed.</p> <p>Queue URLs and names are case-sensitive.</p>
        label: <p>The identification of the permission to remove. This is the label added using the <code> <a>AddPermission</a> </code> action.</p>

    Raises:
        capo_sqs.errors.invalid_address.InvalidAddress: <p>The specified ID is invalid.</p>
        capo_sqs.errors.invalid_security.InvalidSecurity: <p>The request was not made over HTTPS or did not use SigV4 for signing.</p>
        capo_sqs.errors.queue_does_not_exist.QueueDoesNotExist: <p>Ensure that the <code>QueueUrl</code> is correct and that the queue has not been deleted.</p>
        capo_sqs.errors.request_throttled.RequestThrottled: <p>The request was denied due to request throttling.</p> <ul> <li> <p>Exceeds the permitted request rate for the queue or for the recipient of the request.</p> </li> <li> <p>Ensure that the request rate is within the Amazon SQS limits for sending messages. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html#quotas-requests">Amazon SQS quotas</a> in the <i>Amazon SQS Developer Guide</i>.</p> </li> </ul>
        capo_sqs.errors.unsupported_operation.UnsupportedOperation: <p>Error code 400. Unsupported operation.</p>
        capo_sqs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sqs.types.remove_permission_request.RemovePermissionRequest]",
    ) -> OperationResponse[None]:
        import capo_sqs._operations.amazon_sqs.remove_permission

        output, http_response = (
            capo_sqs._operations.amazon_sqs.remove_permission.remove_permission(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RemovePermission")
    )
    input_: capo_sqs.types.remove_permission_request.RemovePermissionRequest = {
        "queue_url": queue_url,
        "label": label,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output