Skip to main content

access_policies

Creates, updates, deletes, gets or lists an access_policies resource.

Overview

Nameaccess_policies
TypeResource
Idaws.opensearchserverless.access_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the policy. (pattern: <code>[a-z][a-z0-9-]+</code>)
created_dateinteger (int64)The date the policy was created.
descriptionstringThe description of the policy.
last_modified_dateinteger (int64)The timestamp of when the policy was last modified.
policyobjectThe JSON policy document without any whitespaces.
policy_versionstringThe version of the policy. (pattern: <code>([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?</code>)
type_stringThe type of access policy. (data)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_access_policyselectregionReturns an OpenSearch Serverless access policy. For more information, see Data access control for Amazon OpenSearch Serverless.
list_access_policiesselectregionReturns information about a list of OpenSearch Serverless access policies.
create_access_policyinsertregion, type, name, policyCreates a data access policy for OpenSearch Serverless. Access policies limit access to collections and the resources within them, and allow a user to access that data irrespective of the access mechanism or network source. For more information, see Data access control for Amazon OpenSearch Serverless.
update_access_policyupdateregion, type, name, policyVersionUpdates an OpenSearch Serverless access policy. For more information, see Data access control for Amazon OpenSearch Serverless.
delete_access_policydeleteregionDeletes an OpenSearch Serverless access policy. For more information, see Data access control for Amazon OpenSearch Serverless.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns an OpenSearch Serverless access policy. For more information, see Data access control for Amazon OpenSearch Serverless.

SELECT
name,
created_date,
description,
last_modified_date,
policy,
policy_version,
type_
FROM aws.opensearchserverless.access_policies
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a data access policy for OpenSearch Serverless. Access policies limit access to collections and the resources within them, and allow a user to access that data irrespective of the access mechanism or network source. For more information, see Data access control for Amazon OpenSearch Serverless.

INSERT INTO aws.opensearchserverless.access_policies (
type,
name,
description,
policy,
clientToken,
region
)
SELECT
'{{ type }}' /* required */,
'{{ name }}' /* required */,
'{{ description }}',
'{{ policy }}' /* required */,
'{{ clientToken }}',
'{{ region }}'
RETURNING
access_policy_detail
;

UPDATE examples

Updates an OpenSearch Serverless access policy. For more information, see Data access control for Amazon OpenSearch Serverless.

UPDATE aws.opensearchserverless.access_policies
SET
type = '{{ type }}',
name = '{{ name }}',
policyVersion = '{{ policyVersion }}',
description = '{{ description }}',
policy = '{{ policy }}',
clientToken = '{{ clientToken }}'
WHERE
region = '{{ region }}' --required
AND type = '{{ type }}' --required
AND name = '{{ name }}' --required
AND policyVersion = '{{ policyVersion }}' --required
RETURNING
access_policy_detail;

DELETE examples

Deletes an OpenSearch Serverless access policy. For more information, see Data access control for Amazon OpenSearch Serverless.

DELETE FROM aws.opensearchserverless.access_policies
WHERE region = '{{ region }}' --required
;