EventBridgeV2 / Client / get_resource_policy

get_resource_policy

EventBridgeV2.Client.get_resource_policy(**kwargs)

Returns the named resource policy attached to an event bus. Fails with ResourceNotFoundException when the event bus or the named policy does not exist.

See also: AWS API Documentation

Request Syntax

response = client.get_resource_policy(
    ResourceArn='string',
    PolicyName='string'
)
Parameters:
  • ResourceArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) that uniquely identifies an event bus.

  • PolicyName (string) – Which named policy to read. Defaults to “default” when omitted (a read AWS Resource Access Manager makes on the owner’s behalf resolves to “AWS_RAM” instead). Unlike writing, neither name is reserved on a read: the bus owner can read both. There is no fallback between the two, so a bus shared only through Resource Access Manager fails with ResourceNotFoundException until “AWS_RAM” is named explicitly. A well-formed name that is neither of the two fails with InvalidInputException.

Return type:

dict

Returns:

Response Syntax

{
    'ResourceArn': 'string',
    'PolicyDocument': 'string',
    'PolicyName': 'string',
    'RevisionId': 'string'
}

Response Structure

  • (dict) –

    Returned only when the named policy exists. A missing event bus or a missing named policy fails with ResourceNotFoundException rather than returning an empty or null policy document. Every member is therefore always present on a successful response.

    • ResourceArn (string) –

      The Amazon Resource Name (ARN) that uniquely identifies an event bus.

    • PolicyDocument (string) –

      A resource policy document, as a JSON string. The “default” policy can be up to 20 KB (20,480 bytes of UTF-8) by default. This quota is adjustable in Service Quotas. A “default” policy that exceeds the quota is rejected with PolicyLengthExceededException. No policy document can exceed 389,120 bytes of UTF-8, regardless of the quota.

    • PolicyName (string) –

      Name of a policy attached to a resource. Valid values: “default” (the customer-managed policy) and “AWS_RAM” (managed exclusively by AWS Resource Access Manager). Any other value is rejected.

    • RevisionId (string) –

      Revision ID of a resource policy. A new revision ID is generated on every successful write.

Exceptions