access_policies
Creates, updates, deletes, gets or lists an access_policies resource.
Overview
| Name | access_policies |
| Type | Resource |
| Id | aws.opensearchserverless.access_policies |
Fields
The following fields are returned by SELECT queries:
- get_access_policy
- list_access_policies
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the policy. (pattern: <code>[a-z][a-z0-9-]+</code>) |
created_date | integer (int64) | The date the policy was created. |
description | string | The description of the policy. |
last_modified_date | integer (int64) | The timestamp of when the policy was last modified. |
policy | object | The JSON policy document without any whitespaces. |
policy_version | string | The version of the policy. (pattern: <code>([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?</code>) |
type_ | string | The type of access policy. (data) |
| Name | Datatype | Description |
|---|---|---|
access_policy_summaries | array | Details about the requested access policies. |
next_token | string | When nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_access_policy | select | region | Returns an OpenSearch Serverless access policy. For more information, see Data access control for Amazon OpenSearch Serverless. | |
list_access_policies | select | region | Returns information about a list of OpenSearch Serverless access policies. | |
create_access_policy | insert | region, type, name, policy | 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. | |
update_access_policy | update | region, type, name, policyVersion | Updates an OpenSearch Serverless access policy. For more information, see Data access control for Amazon OpenSearch Serverless. | |
delete_access_policy | delete | region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_access_policy
- list_access_policies
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
;
Returns information about a list of OpenSearch Serverless access policies.
SELECT
access_policy_summaries,
next_token
FROM aws.opensearchserverless.access_policies
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_access_policy
- Manifest
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
;
# Description fields are for documentation purposes
- name: access_policies
props:
- name: region
value: "{{ region }}"
description: Required parameter for the access_policies resource.
- name: type
value: "{{ type }}"
description: |
The type of policy.
valid_values: ['data']
- name: name
value: "{{ name }}"
description: |
The name of the policy.
- name: description
value: "{{ description }}"
description: |
A description of the policy. Typically used to store information about the permissions defined in the policy.
- name: policy
value: "{{ policy }}"
description: |
The JSON policy document to use as the content for the policy.
- name: clientToken
value: "{{ clientToken }}"
description: |
Unique, case-sensitive identifier to ensure idempotency of the request.
UPDATE examples
- update_access_policy
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
- delete_access_policy
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
;