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

Allows you to specify if you want to use both resource-level and account/catalog-level resource policies. A resource-level policy is a policy attached to an individual resource such as a database or a table.

The default value of NO indicates that resource-level policies cannot co-exist with an account-level policy. A value of YES means the use of both resource-level and account/catalog-level resource policies is allowed.

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 will 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

The ARN of the AWS Glue resource for the resource policy to be set. For more information about AWS Glue resource ARNs, see the AWS Glue ARN string pattern

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: