create_security_policy
¶
create_security_policy(
type: SecurityPolicyType,
name: PolicyName,
policy: PolicyDocument,
*,
config_overrides: Optional[OpenSearchServerlessClientConfig] = None,
description: Optional[PolicyDescription] = None,
client_token: Optional[ClientToken] = None,
) -> CreateSecurityPolicyResponse
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.
Parameters:
-
type(SecurityPolicyType) –The type of security policy.
-
name(PolicyName) –The name of the policy.
-
description(Optional[PolicyDescription], default:None) –A description of the policy. Typically used to store information about the permissions defined in the policy.
-
policy(PolicyDocument) –The JSON policy document to use as the content for the new policy.
-
client_token(Optional[ClientToken], default:None) –Unique, case-sensitive identifier to ensure idempotency of the request.
Raises:
-
ConflictException–When creating a resource, thrown when a resource with the same name already exists or is being created. When deleting a resource, thrown when the resource is not in the ACTIVE, FAILED, or UPDATE_FAILED state.
-
InternalServerException–Thrown when an error internal to the service occurs while processing a request.
-
ServiceQuotaExceededException–Thrown when you attempt to create more resources than the service allows based on service quotas.
-
ValidationException–Thrown when the HTTP request contains invalid input or is missing required input.
-
UnknownServiceError–The service returned an error code this client does not model.