RemovePermission
Revokes any permissions in the queue policy that matches the specified
Label
parameter.
Note
-
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
, andSetQueueAttributes
actions in your IAM policy.
Request Syntax
{
"Label": "string
",
"QueueUrl": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- Label
-
The identification of the permission to remove. This is the label added using the
AddPermission
action.Type: String
Required: Yes
- QueueUrl
-
The URL of the Amazon SQS queue from which permissions are removed.
Queue URLs and names are case-sensitive.
Type: String
Required: Yes
Response Elements
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
Errors
For information about the errors that are common to all actions, see Common Errors.
- InvalidAddress
-
The specified ID is invalid.
HTTP Status Code: 400
- InvalidSecurity
-
The request was not made over HTTPS or did not use SigV4 for signing.
HTTP Status Code: 400
- QueueDoesNotExist
-
Ensure that the
QueueUrl
is correct and that the queue has not been deleted.HTTP Status Code: 400
- 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.
HTTP Status Code: 400
-
- UnsupportedOperation
-
Error code 400. Unsupported operation.
HTTP Status Code: 400
Examples
The following example query request removes the MyLabel
permission
from the queue named MyQueue
. The structure of AUTHPARAMS
depends on the signature of the API request.
For more information, see
Examples of Signed Signature Version 4 Requests in the
AWS General Reference.
Example
Using AWS JSON protocol (Default)
Sample Request
POST / HTTP/1.1
Host: sqs.us-east-1.amazonaws.com
X-Amz-Target: AmazonSQS.RemovePermission
X-Amz-Date: <Date>
Content-Type: application/x-amz-json-1.0
Authorization: <AuthParams>
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
{
"QueueUrl": "https://sqs.us-east-1.amazonaws.com/177715257436/MyQueue/",
"Label": "MyLabel"
}
Sample Response
HTTP/1.1 200 OK
x-amzn-RequestId: <requestId>
Content-Length: 0
Date: <Date>
Content-Type: application/x-amz-json-1.0
Example
Using AWS query protocol
Sample Request
POST /177715257436/MyQueue/ HTTP/1.1
Host: sqs.us-east-1.amazonaws.com
X-Amz-Date: <Date>
Content-Type: application/x-www-form-urlencoded
Authorization: <AuthParams>
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
Action=RemovePermission&Label=MyLabel
Sample Response
HTTP/1.1 200 OK
<?xml version="1.0"?>
<RemovePermissionResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">
<ResponseMetadata>
<RequestId>133cc8b8-21a1-5aba-b65a-94c8e50d917f</RequestId>
</ResponseMetadata>
</RemovePermissionResponse>
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: