

# GetResourcePolicy
<a name="API_GetResourcePolicy"></a>

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

## Request Parameters
<a name="API_GetResourcePolicy_RequestParameters"></a>

 ** PolicyName **   
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.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `[A-Za-z0-9_]+`   
Required: No

 ** ResourceArn **   
The Amazon Resource Name (ARN) that uniquely identifies an event bus.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 1011.  
Pattern: `arn:aws(-[a-z0-9]+)*:events:[a-z][a-z0-9]*(-[a-z0-9]+)*:([0-9]{12}):event-busv2\/[A-Za-z0-9][\.\-_A-Za-z0-9]{0,255}\/[a-z0-9]{25}`   
Required: Yes

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

The following elements are returned by the service.

 ** PolicyDocument **   
A resource policy document, as a JSON string. The maximum size is 389,120 bytes of UTF-8; the byte limit is enforced by the service.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 389120.

 ** PolicyName **   
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.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `[A-Za-z0-9_]+` 

 ** ResourceArn **   
The Amazon Resource Name (ARN) that uniquely identifies an event bus.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 1011.  
Pattern: `arn:aws(-[a-z0-9]+)*:events:[a-z][a-z0-9]*(-[a-z0-9]+)*:([0-9]{12}):event-busv2\/[A-Za-z0-9][\.\-_A-Za-z0-9]{0,255}\/[a-z0-9]{25}` 

 ** RevisionId **   
Revision ID of a resource policy. A new revision ID is generated on every successful write.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.

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

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

 ** AccessDeniedException **   
The caller does not have the permissions required to perform the operation. This error is also returned when the operation cannot use the AWS KMS key for the event bus.  
HTTP Status Code: 403

 ** InternalException **   
The request failed because of an internal service error. Retry the request.  
HTTP Status Code: 500

 ** InvalidInputException **   
A request parameter is missing or not valid.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The resource does not exist.  
HTTP Status Code: 404

 ** ThrottlingException **   
The request was throttled because it exceeds a request rate limit. Retry the request with backoff.  
HTTP Status Code: 429

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

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/eventbridgev2-2025-05-15/GetResourcePolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/eventbridgev2-2025-05-15/GetResourcePolicy) 
+  [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/eventbridgev2-2025-05-15/GetResourcePolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/eventbridgev2-2025-05-15/GetResourcePolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/eventbridgev2-2025-05-15/GetResourcePolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/eventbridgev2-2025-05-15/GetResourcePolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/eventbridgev2-2025-05-15/GetResourcePolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/eventbridgev2-2025-05-15/GetResourcePolicy) 
+  [AWS SDK for Python (Boto3)](https://docs.aws.amazon.com/goto/boto3/eventbridgev2-2025-05-15/GetResourcePolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/eventbridgev2-2025-05-15/GetResourcePolicy) 