CreateRLSPolicy - Lake Formation
Services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the AWS European Sovereign Cloud Region, see the AWS European Sovereign Cloud User Guide.

CreateRLSPolicy

Creates a row-level security (RLS) policy. A row-level security policy defines a filter expression that AWS Lake Formation evaluates to determine which rows of a table a principal is allowed to see. The policy is created independently of any resource, and is later associated with a resource and principal using AttachRLSPolicy.

Request Syntax

POST /CreateRLSPolicy HTTP/1.1 Content-type: application/json { "AttachmentColumns": [ { "Name": "string", "Type": "string" } ], "FilterExpression": "string", "Name": "string" }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

AttachmentColumns

The list of columns that the filter expression references. These columns define the shape of the data that the policy can be attached to.

Type: Array of Column objects

Required: Yes

FilterExpression

A filter predicate, written in a SQL-like syntax, that AWS Lake Formation evaluates against each row. Only the rows for which the expression evaluates to true are returned to the principal.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 2048.

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

Required: Yes

Name

A unique name for the row-level security policy within the Data Catalog.

Type: String

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

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

Required: Yes

Response Syntax

HTTP/1.1 200

Response Elements

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

Errors

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

AccessDeniedException

Access to a resource was denied.

Message

A message describing the problem.

HTTP Status Code: 403

AlreadyExistsException

A resource to be created or added already exists.

Message

A message describing the problem.

HTTP Status Code: 400

ConcurrentModificationException

Two processes are trying to modify a resource simultaneously.

Message

A message describing the problem.

HTTP Status Code: 400

InternalServiceException

An internal service error occurred.

Message

A message describing the problem.

HTTP Status Code: 500

InvalidInputException

The input provided was not valid.

Message

A message describing the problem.

HTTP Status Code: 400

OperationTimeoutException

The operation timed out.

Message

A message describing the problem.

HTTP Status Code: 400

ResourceNumberLimitExceededException

A resource numerical limit was exceeded.

Message

A message describing the problem.

HTTP Status Code: 400

Examples

Request example

This example illustrates one usage of CreateRLSPolicy.

{ "Name": "sales-east-region", "AttachmentColumns": [ { "Name": "region", "Type": "string" } ], "FilterExpression": "region = 'east'" }

See Also

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