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
Idawscc.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.

For more information, see AWS::OpenSearchServerless::SecurityPolicy.

Methods

NameResourceAccessible byRequired Params
create_resourcesecurity_policiesINSERTType, Name, Policy, region
delete_resourcesecurity_policiesDELETEIdentifier, region
update_resourcesecurity_policiesUPDATEIdentifier, PatchDocument, region
list_resourcessecurity_policies_list_onlySELECTregion
get_resourcesecurity_policiesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual security_policy.

SELECT
region,
description,
policy,
name,
type
FROM awscc.opensearchserverless.security_policies
WHERE
region = 'us-east-1' AND
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 awscc.opensearchserverless.security_policies (
Policy,
Name,
Type,
region
)
SELECT
'{{ policy }}',
'{{ name }}',
'{{ type }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a security_policy resource, using stack-deploy.

/*+ update */
UPDATE awscc.opensearchserverless.security_policies
SET PatchDocument = string('{{ {
"Description": description,
"Policy": policy
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ type }}|{{ name }}';

DELETE example

/*+ delete */
DELETE FROM awscc.opensearchserverless.security_policies
WHERE
Identifier = '{{ type }}|{{ name }}' AND
region = 'us-east-1';

Permissions

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

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