

# DeleteResourcePolicy
<a name="API_DeleteResourcePolicy"></a>

Deletes a [resource-based policy](https://docs.amazonaws.cn/lambda/latest/dg/access-control-resource-based.html) from a Lambda resource.

## Request Syntax
<a name="API_DeleteResourcePolicy_RequestSyntax"></a>

```
DELETE /2026-07-09/resource-policy/{{ResourceArn}}?RevisionId={{RevisionId}} HTTP/1.1
```

## URI Request Parameters
<a name="API_DeleteResourcePolicy_RequestParameters"></a>

The request uses the following URI parameters.

 ** [ResourceArn](#API_DeleteResourcePolicy_RequestSyntax) **   <a name="lambda-DeleteResourcePolicy-request-uri-ResourceArn"></a>
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](#API_DeleteResourcePolicy_RequestSyntax) **   <a name="lambda-DeleteResourcePolicy-request-uri-RevisionId"></a>
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 `PreconditionFailedException` error. To retrieve the current revision ID, use the [GetResourcePolicy](API_GetResourcePolicy.md) 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
<a name="API_DeleteResourcePolicy_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_DeleteResourcePolicy_ResponseSyntax"></a>

```
HTTP/1.1 204
```

## Response Elements
<a name="API_DeleteResourcePolicy_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body.

## Errors
<a name="API_DeleteResourcePolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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 `GetPolicy` to retrieve the latest RevisionId for your resource.
+  **For all other API operations:** Call `GetFunction` or `GetAlias` to 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 Amazon Lambda service encountered an internal error.  
HTTP Status Code: 500

 ** TooManyRequestsException **   
The request throughput limit was exceeded. For more information, see [Lambda quotas](https://docs.amazonaws.cn/lambda/latest/dg/gettingstarted-limits.html#api-requests).    
 ** retryAfterSeconds **   
The number of seconds the caller should wait before retrying.
HTTP Status Code: 429

## See Also
<a name="API_DeleteResourcePolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/lambda-2015-03-31/DeleteResourcePolicy) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/lambda-2015-03-31/DeleteResourcePolicy) 
+  [Amazon SDK for C\+\+](https://docs.amazonaws.cn/goto/SdkForCpp/lambda-2015-03-31/DeleteResourcePolicy) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/lambda-2015-03-31/DeleteResourcePolicy) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/lambda-2015-03-31/DeleteResourcePolicy) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/lambda-2015-03-31/DeleteResourcePolicy) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/lambda-2015-03-31/DeleteResourcePolicy) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/lambda-2015-03-31/DeleteResourcePolicy) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/lambda-2015-03-31/DeleteResourcePolicy) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/lambda-2015-03-31/DeleteResourcePolicy) 