Skip to main content

access_policies

Creates, updates, deletes or gets an access_policy resource or lists access_policies in a region

Overview

Nameaccess_policies
TypeResource
DescriptionAmazon OpenSearchServerless access policy resource
Idaws.opensearchserverless.access_policies

Fields

NameDatatypeDescription
namestringThe name of the policy
typestringThe possible types for the access policy
descriptionstringThe description of the policy
policystringThe JSON policy document that is the content for the policy
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTType, Name, Policy, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all access_policies in a region.

SELECT
region,
name,
type,
description,
policy
FROM aws.opensearchserverless.access_policies
WHERE region = 'us-east-1';

Gets all properties from an individual access_policy.

SELECT
region,
name,
type,
description,
policy
FROM aws.opensearchserverless.access_policies
WHERE region = 'us-east-1' AND data__Identifier = '<Type>|<Name>';

INSERT example

Use the following StackQL query and manifest file to create a new access_policy resource, using stack-deploy.

/*+ create */
INSERT INTO aws.opensearchserverless.access_policies (
Name,
Type,
Policy,
region
)
SELECT
'{{ Name }}',
'{{ Type }}',
'{{ Policy }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.opensearchserverless.access_policies
WHERE data__Identifier = '<Type|Name>'
AND region = 'us-east-1';

Permissions

To operate on the access_policies resource, the following permissions are required:

Create

aoss:CreateAccessPolicy,
aoss:GetAccessPolicy

Read

aoss:GetAccessPolicy

Update

aoss:UpdateAccessPolicy,
aoss:GetAccessPolicy

Delete

aoss:DeleteAccessPolicy,
aoss:GetAccessPolicy

List

aoss:ListAccessPolicies