Adds a resource-based policy to a Lambda resource¶
Description¶
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).
This operation replaces any existing policy on the Lambda resource. If you previously added permissions using the add_permission operation, the new policy overwrites those permissions.
Usage¶
Arguments¶
-
ResourceArn[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.
-
Policy[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.
-
RevisionIdThe 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
PreconditionFailedExceptionerror. To retrieve the current revision ID, use theget_resource_policyoperation.
Value¶
A list with the following syntax: