Skip to content

Latest commit

 

History

History
90 lines (65 loc) · 3.57 KB

opensearchserverless_collection.html.markdown

File metadata and controls

90 lines (65 loc) · 3.57 KB
subcategory layout page_title description
OpenSearch Serverless
aws
AWS: aws_opensearchserverless_collection
Terraform resource for managing an AWS OpenSearch Collection.

Resource: aws_opensearchserverless_collection

Terraform resource for managing an AWS OpenSearch Serverless Collection.

~> NOTE: An aws_opensearchserverless_collection cannot be created without having an applicable encryption security policy. Use the depends_on meta-argument to define this dependency.

~> NOTE: An aws_opensearchserverless_collection is not accessible without configuring an applicable network security policy. Data cannot be accessed without configuring an applicable data access policy.

Example Usage

Basic Usage

resource "aws_opensearchserverless_security_policy" "example" {
  name = "example"
  type = "encryption"
  policy = jsonencode({
    "Rules" = [
      {
        "Resource" = [
          "collection/example"
        ],
        "ResourceType" = "collection"
      }
    ],
    "AWSOwnedKey" = true
  })
}

resource "aws_opensearchserverless_collection" "example" {
  name = "example"

  depends_on = [aws_opensearchserverless_security_policy.example]
}

Argument Reference

The following arguments are required:

  • name - (Required) Name of the collection.

The following arguments are optional:

  • description - (Optional) Description of the collection.
  • standby_replicas - (Optional) Indicates whether standby replicas should be used for a collection. One of ENABLED or DISABLED. Defaults to ENABLED.
  • tags - (Optional) A map of tags to assign to the collection. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
  • type - (Optional) Type of collection. One of SEARCH, TIMESERIES, or VECTORSEARCH. Defaults to TIMESERIES.

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

  • arn - Amazon Resource Name (ARN) of the collection.
  • collection_endpoint - Collection-specific endpoint used to submit index, search, and data upload requests to an OpenSearch Serverless collection.
  • dashboard_endpoint - Collection-specific endpoint used to access OpenSearch Dashboards.
  • kms_key_arn - The ARN of the Amazon Web Services KMS key used to encrypt the collection.
  • id - Unique identifier for the collection.

Timeouts

Configuration options:

  • create - (Default 20m)
  • delete - (Default 20m)

Import

In Terraform v1.5.0 and later, use an import block to import OpenSearchServerless Collection using the id. For example:

import {
  to = aws_opensearchserverless_collection.example
  id = "example"
}

Using terraform import, import OpenSearchServerless Collection using the id. For example:

% terraform import aws_opensearchserverless_collection.example example