DeleteResourcePolicy
Deletes a resource-based policy from a Lambda resource.
Request Syntax
DELETE /2026-07-09/resource-policy/ResourceArn?RevisionId=RevisionId HTTP/1.1
URI Request Parameters
The request uses the following URI parameters.
- ResourceArn
-
The Amazon Resource Name (ARN) of the Lambda resource you want to delete the policy from. You can use a qualified or an unqualified ARN. The value must be a complete ARN, and the operation does not accept wildcard characters.
Length Constraints: Minimum length of 0. Maximum length of 256.
Pattern:
arn:(aws[a-zA-Z-]*)?:lambda:(eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST(\.PUBLISHED)?|[a-zA-Z0-9-_])+)?Required: Yes
- RevisionId
-
The revision ID that the existing policy must match for the deletion to proceed. If the revision ID doesn't match, the operation fails with a
PreconditionFailedExceptionerror. To retrieve the current revision ID, use the GetResourcePolicy operation.Length Constraints: Fixed length of 36.
Pattern:
[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 204
Response Elements
If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body.
Errors
For information about the errors that are common to all actions, see Common Error Types.
- InvalidParameterValueException
-
One of the parameters in the request is not valid.
- message
-
The exception message.
- Type
-
The exception type.
HTTP Status Code: 400
- PreconditionFailedException
-
The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.
-
For AddPermission and RemovePermission API operations: Call
GetPolicyto retrieve the latest RevisionId for your resource. -
For all other API operations: Call
GetFunctionorGetAliasto retrieve the latest RevisionId for your resource.
- message
-
The exception message.
- Type
-
The exception type.
HTTP Status Code: 412
-
- ResourceConflictException
-
The resource already exists, or another operation is in progress.
- message
-
The exception message.
- Type
-
The exception type.
HTTP Status Code: 409
- ResourceNotFoundException
-
The resource specified in the request does not exist.
HTTP Status Code: 404
- ServiceException
-
The AWS Lambda service encountered an internal error.
HTTP Status Code: 500
- TooManyRequestsException
-
The request throughput limit was exceeded. For more information, see Lambda quotas.
- retryAfterSeconds
-
The number of seconds the caller should wait before retrying.
HTTP Status Code: 429
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: