OpenSearchServiceServerless / Client / create_access_policy
create_access_policy#
- OpenSearchServiceServerless.Client.create_access_policy(**kwargs)#
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.
See also: AWS API Documentation
Request Syntax
response = client.create_access_policy( type='data', name='string', description='string', policy='string', clientToken='string' )
- Parameters:
type (string) –
[REQUIRED]
The type of policy.
name (string) –
[REQUIRED]
The name of the policy.
description (string) – A description of the policy. Typically used to store information about the permissions defined in the policy.
policy (string) –
[REQUIRED]
The JSON policy document to use as the content for the policy.
clientToken (string) –
Unique, case-sensitive identifier to ensure idempotency of the request.
This field is autopopulated if not provided.
- Return type:
dict
- Returns:
Response Syntax
{ 'accessPolicyDetail': { 'type': 'data', 'name': 'string', 'policyVersion': 'string', 'description': 'string', 'policy': {...}|[...]|123|123.4|'string'|True|None, 'createdDate': 123, 'lastModifiedDate': 123 } }
Response Structure
(dict) –
accessPolicyDetail (dict) –
Details about the created access policy.
type (string) –
The type of access policy.
name (string) –
The name of the policy.
policyVersion (string) –
The version of the policy.
description (string) –
The description of the policy.
policy (document) –
The JSON policy document without any whitespaces.
createdDate (integer) –
The date the policy was created.
lastModifiedDate (integer) –
The timestamp of when the policy was last modified.
Exceptions