Skip to main content

security_policies

Creates, updates, deletes or gets a security_policy resource or lists security_policies in a region

Overview

Namesecurity_policies
TypeResource
DescriptionAmazon OpenSearchServerless security policy resource
Idaws.opensearchserverless.security_policies

Fields

NameDatatypeDescription
descriptionstringThe description of the policy
policystringThe JSON policy document that is the content for the policy
namestringThe name of the policy
typestringThe possible types for the network 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 security_policies in a region.

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

Gets all properties from an individual security_policy.

SELECT
region,
description,
policy,
name,
type
FROM aws.opensearchserverless.security_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 security_policy resource, using stack-deploy.

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

DELETE example

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

Permissions

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

Create

aoss:GetSecurityPolicy,
aoss:CreateSecurityPolicy,
kms:DescribeKey,
kms:CreateGrant

Update

aoss:GetSecurityPolicy,
aoss:UpdateSecurityPolicy,
kms:DescribeKey,
kms:CreateGrant

Delete

aoss:GetSecurityPolicy,
aoss:DeleteSecurityPolicy

List

aoss:ListSecurityPolicies

Read

aoss:GetSecurityPolicy,
kms:DescribeKey