PutResourcePolicy - AWS Glue

PutResourcePolicy

Sets the Data Catalog resource policy for access control.

Request Syntax

{ "EnableHybrid": "string", "PolicyExistsCondition": "string", "PolicyHashCondition": "string", "PolicyInJson": "string", "ResourceArn": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

EnableHybrid

If 'TRUE', indicates that you are using both methods to grant cross-account access to Data Catalog resources:

  • By directly updating the resource policy with PutResourePolicy

  • By using the Grant permissions command on the AWS Management Console.

Must be set to 'TRUE' if you have already used the Management Console to grant cross-account access, otherwise the call fails. Default is 'FALSE'.

Type: String

Valid Values: TRUE | FALSE

Required: No

PolicyExistsCondition

A value of MUST_EXIST is used to update a policy. A value of NOT_EXIST is used to create a new policy. If a value of NONE or a null value is used, the call does not depend on the existence of a policy.

Type: String

Valid Values: MUST_EXIST | NOT_EXIST | NONE

Required: No

PolicyHashCondition

The hash value returned when the previous policy was set using PutResourcePolicy. Its purpose is to prevent concurrent modifications of a policy. Do not use this parameter if no previous policy has been set.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 255.

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*

Required: No

PolicyInJson

Contains the policy document to set, in JSON format.

Type: String

Length Constraints: Minimum length of 2. Maximum length of 10240.

Required: Yes

ResourceArn

Do not use. For internal use only.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 10240.

Pattern: arn:aws:glue:.*

Required: No

Response Syntax

{ "PolicyHash": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

PolicyHash

A hash of the policy that has just been set. This must be included in a subsequent call that overwrites or updates this policy.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 255.

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*

Errors

For information about the errors that are common to all actions, see Common Errors.

ConditionCheckFailureException

A specified condition was not satisfied.

HTTP Status Code: 400

EntityNotFoundException

A specified entity does not exist

HTTP Status Code: 400

InternalServiceException

An internal service error occurred.

HTTP Status Code: 500

InvalidInputException

The input provided was not valid.

HTTP Status Code: 400

OperationTimeoutException

The operation timed out.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: