

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

Get the resource policy for a specified resource.

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

 For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

 ** ResourceArn **   
The Amazon Resource Name (ARN) of the resource of which its resource policy is fetched.  
Type: String  
Length Constraints: Maximum length of 2147483647.  
Required: Yes

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

The following element is returned by the service.

 ** ResourcePolicy **   
The content of the resource policy.  
Type: [ResourcePolicy](API_ResourcePolicy.md) object

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

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

 ** InvalidPolicyFault **   
The resource policy isn't valid.  
HTTP Status Code: 400

 ** ResourceNotFoundFault **   
The resource could not be found.  
HTTP Status Code: 404

 ** UnsupportedOperation **   
The requested operation isn't supported.  
HTTP Status Code: 400

## See Also
<a name="API_GetResourcePolicy_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/redshift-2012-12-01/GetResourcePolicy) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/redshift-2012-12-01/GetResourcePolicy) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/redshift-2012-12-01/GetResourcePolicy) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/redshift-2012-12-01/GetResourcePolicy) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/redshift-2012-12-01/GetResourcePolicy) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/redshift-2012-12-01/GetResourcePolicy) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/redshift-2012-12-01/GetResourcePolicy) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/redshift-2012-12-01/GetResourcePolicy) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/redshift-2012-12-01/GetResourcePolicy) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/redshift-2012-12-01/GetResourcePolicy) 