2026/08/20 - AWS Lambda - 3 new api methods
Changes Adds support for full JSON resource-based policies, enabling customers to create, retrieve, update, and delete function resource policies as complete JSON documents.
Retrieves the resource-based policy attached to a Lambda resource.
See also: AWS API Documentation
Request Syntax
client.get_resource_policy(
ResourceArn='string'
)
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Lambda resource you want to retrieve the policy for. You can use a qualified or an unqualified ARN. The value must be a complete ARN, and the operation does not accept wildcard characters.
dict
Response Syntax
{
'Policy': 'string',
'RevisionId': 'string'
}
Response Structure
(dict) --
Policy (string) --
The resource-based policy attached to the Lambda resource you specified.
RevisionId (string) --
The revision ID of the policy. Pass this value as the RevisionId in a PutResourcePolicy or DeleteResourcePolicy request. Doing so ensures the operation acts on the expected version of the policy.
Deletes a resource-based policy from a Lambda resource.
See also: AWS API Documentation
Request Syntax
client.delete_resource_policy(
ResourceArn='string',
RevisionId='string'
)
string
[REQUIRED]
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.
string
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 operation.
None
Adds a resource-based policy to a Lambda resource. Resource-based policies grant access to other Amazon Web Services accounts, organizations, or services. Resource-based policies apply to a single Lambda resource (for example, a function, function version, or function alias).
See also: AWS API Documentation
Request Syntax
client.put_resource_policy(
ResourceArn='string',
Policy='string',
RevisionId='string'
)
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Lambda resource you want to add the policy to. You can use a qualified or an unqualified ARN. The value must be a complete ARN, and the operation does not accept wildcard characters.
string
[REQUIRED]
The policy document you want to add to your Lambda resource. This is formatted as a JSON string.
For more information, see Working with resource-based policies in Lambda in the Lambda Developer Guide.
string
The revision ID that the existing policy must match for the replacement 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 operation.
dict
Response Syntax
{
'Policy': 'string',
'RevisionId': 'string'
}
Response Structure
(dict) --
Policy (string) --
The resource-based policy that Lambda adds to the resource.
RevisionId (string) --
The revision ID of the policy that Lambda adds to your Lambda resource.