subcategory | layout | page_title | description |
---|---|---|---|
OpenSearch Serverless |
aws |
AWS: aws_opensearchserverless_collection |
Terraform resource for managing an AWS OpenSearch 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.
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]
}
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 ofENABLED
orDISABLED
. Defaults toENABLED
.tags
- (Optional) A map of tags to assign to the collection. If configured with a providerdefault_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.type
- (Optional) Type of collection. One ofSEARCH
,TIMESERIES
, orVECTORSEARCH
. Defaults toTIMESERIES
.
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.
create
- (Default20m
)delete
- (Default20m
)
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