security_policies
Creates, updates, deletes, gets or lists a security_policies resource.
Overview
| Name | security_policies |
| Type | Resource |
| Id | aws.opensearchserverless.security_policies |
Fields
The following fields are returned by SELECT queries:
- get_security_policy
- list_security_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 security 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 security policy. (encryption, network) |
| Name | Datatype | Description |
|---|---|---|
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. |
security_policy_summaries | array | Details about the security policies in your account. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_security_policy | select | region | Returns information about a configured OpenSearch Serverless security policy. For more information, see Network access for Amazon OpenSearch Serverless and Encryption at rest for Amazon OpenSearch Serverless. | |
list_security_policies | select | region | Returns information about configured OpenSearch Serverless security policies. | |
create_security_policy | insert | region, type, name, policy | Creates a security policy to be used by one or more OpenSearch Serverless collections. Security policies provide access to a collection and its OpenSearch Dashboards endpoint from public networks or specific VPC endpoints. They also allow you to secure a collection with a KMS encryption key. For more information, see Network access for Amazon OpenSearch Serverless and Encryption at rest for Amazon OpenSearch Serverless. | |
update_security_policy | update | region, type, name, policyVersion | Updates an OpenSearch Serverless security policy. For more information, see Network access for Amazon OpenSearch Serverless and Encryption at rest for Amazon OpenSearch Serverless. | |
delete_security_policy | delete | region | Deletes an OpenSearch Serverless security policy. |
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_security_policy
- list_security_policies
Returns information about a configured OpenSearch Serverless security policy. For more information, see Network access for Amazon OpenSearch Serverless and Encryption at rest for Amazon OpenSearch Serverless.
SELECT
name,
created_date,
description,
last_modified_date,
policy,
policy_version,
type_
FROM aws.opensearchserverless.security_policies
WHERE region = '{{ region }}' -- required
;
Returns information about configured OpenSearch Serverless security policies.
SELECT
next_token,
security_policy_summaries
FROM aws.opensearchserverless.security_policies
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_security_policy
- Manifest
Creates a security policy to be used by one or more OpenSearch Serverless collections. Security policies provide access to a collection and its OpenSearch Dashboards endpoint from public networks or specific VPC endpoints. They also allow you to secure a collection with a KMS encryption key. For more information, see Network access for Amazon OpenSearch Serverless and Encryption at rest for Amazon OpenSearch Serverless.
INSERT INTO aws.opensearchserverless.security_policies (
type,
name,
description,
policy,
clientToken,
region
)
SELECT
'{{ type }}' /* required */,
'{{ name }}' /* required */,
'{{ description }}',
'{{ policy }}' /* required */,
'{{ clientToken }}',
'{{ region }}'
RETURNING
security_policy_detail
;
# Description fields are for documentation purposes
- name: security_policies
props:
- name: region
value: "{{ region }}"
description: Required parameter for the security_policies resource.
- name: type
value: "{{ type }}"
description: |
The type of security policy.
valid_values: ['encryption', 'network']
- 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 new policy.
- name: clientToken
value: "{{ clientToken }}"
description: |
Unique, case-sensitive identifier to ensure idempotency of the request.
UPDATE examples
- update_security_policy
Updates an OpenSearch Serverless security policy. For more information, see Network access for Amazon OpenSearch Serverless and Encryption at rest for Amazon OpenSearch Serverless.
UPDATE aws.opensearchserverless.security_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
security_policy_detail;
DELETE examples
- delete_security_policy
Deletes an OpenSearch Serverless security policy.
DELETE FROM aws.opensearchserverless.security_policies
WHERE region = '{{ region }}' --required
;