GetResourcePolicyCommand

Retrieves a specified resource policy.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { GlueClient, GetResourcePolicyCommand } from "@aws-sdk/client-glue"; // ES Modules import
// const { GlueClient, GetResourcePolicyCommand } = require("@aws-sdk/client-glue"); // CommonJS import
const client = new GlueClient(config);
const input = { // GetResourcePolicyRequest
  ResourceArn: "STRING_VALUE",
};
const command = new GetResourcePolicyCommand(input);
const response = await client.send(command);
// { // GetResourcePolicyResponse
//   PolicyInJson: "STRING_VALUE",
//   PolicyHash: "STRING_VALUE",
//   CreateTime: new Date("TIMESTAMP"),
//   UpdateTime: new Date("TIMESTAMP"),
// };

GetResourcePolicyCommand Input

See GetResourcePolicyCommandInput for more details

Parameter
Type
Description
ResourceArn
string | undefined

The ARN of the Glue resource for which to retrieve the resource policy. If not supplied, the Data Catalog resource policy is returned. Use GetResourcePolicies to view all existing resource policies. For more information see Specifying Glue Resource ARNs .

GetResourcePolicyCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
CreateTime
Date | undefined

The date and time at which the policy was created.

PolicyHash
string | undefined

Contains the hash value associated with this policy.

PolicyInJson
string | undefined

Contains the requested policy document, in JSON format.

UpdateTime
Date | undefined

The date and time at which the policy was last updated.

Throws

Name
Fault
Details
EntityNotFoundException
client

A specified entity does not exist

InternalServiceException
server

An internal service error occurred.

InvalidInputException
client

The input provided was not valid.

OperationTimeoutException
client

The operation timed out.

GlueServiceException
Base exception class for all service exceptions from Glue service.