Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Resource]: AWS Opensearch Index #37729

Closed
vicotrbb opened this issue May 28, 2024 · 5 comments
Closed

[New Resource]: AWS Opensearch Index #37729

vicotrbb opened this issue May 28, 2024 · 5 comments
Labels
new-resource Introduces a new resource. service/opensearchserverless Issues and PRs that pertain to the opensearchserverless service.

Comments

@vicotrbb
Copy link

Description

I would like to have a resource to create AWS opensearch (Serverless) indexes.

Requested Resource(s) and/or Data Source(s)

aws_opensearchserverless_index

Potential Terraform Configuration

No response

References

No response

Would you like to implement a fix?

No

Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label May 28, 2024
@justinretzolk justinretzolk added new-resource Introduces a new resource. service/opensearchserverless Issues and PRs that pertain to the opensearchserverless service. and removed needs-triage Waiting for first response or review from a maintainer. labels May 28, 2024
@acwwat
Copy link
Contributor

acwwat commented May 29, 2024

@vicotrbb You can use the OpenSearch Provider to create indices in your OpenSearch Serverless domain today. Here is an example for creating an index for Bedrock knowledge base. However, you must use v2.2.0 of the provider for now, as this issue causes authentication issue with OSS domains.

provider "opensearch" {
  url         = aws_opensearchserverless_collection.forex_kb.collection_endpoint
  healthcheck = false
}

resource "opensearch_index" "forex_kb" {
  name                           = "bedrock-knowledge-base-default-index"
  number_of_shards               = "2"
  number_of_replicas             = "0"
  index_knn                      = true
  index_knn_algo_param_ef_search = "512"
  mappings                       = <<-EOF
    {
      "properties": {
        "bedrock-knowledge-base-default-vector": {
          "type": "knn_vector",
          "dimension": 1536,
          "method": {
            "name": "hnsw",
            "engine": "faiss",
            "parameters": {
              "m": 16,
              "ef_construction": 512
            },
            "space_type": "l2"
          }
        },
        "AMAZON_BEDROCK_METADATA": {
          "type": "text",
          "index": "false"
        },
        "AMAZON_BEDROCK_TEXT_CHUNK": {
          "type": "text",
          "index": "true"
        }
      }
    }
  EOF
  force_destroy                  = true
  depends_on                     = [aws_opensearchserverless_collection.forex_kb]
}

@abriko
Copy link

abriko commented Jun 18, 2024

@vicotrbb You can use the OpenSearch Provider to create indices in your OpenSearch Serverless domain today. Here is an example for creating an index for Bedrock knowledge base. However, you must use v2.2.0 of the provider for now, as this issue causes authentication issue with OSS domains.

provider "opensearch" {
  url         = aws_opensearchserverless_collection.forex_kb.collection_endpoint
  healthcheck = false
}

resource "opensearch_index" "forex_kb" {
  name                           = "bedrock-knowledge-base-default-index"
  number_of_shards               = "2"
  number_of_replicas             = "0"
  index_knn                      = true
  index_knn_algo_param_ef_search = "512"
  mappings                       = <<-EOF
    {
      "properties": {
        "bedrock-knowledge-base-default-vector": {
          "type": "knn_vector",
          "dimension": 1536,
          "method": {
            "name": "hnsw",
            "engine": "faiss",
            "parameters": {
              "m": 16,
              "ef_construction": 512
            },
            "space_type": "l2"
          }
        },
        "AMAZON_BEDROCK_METADATA": {
          "type": "text",
          "index": "false"
        },
        "AMAZON_BEDROCK_TEXT_CHUNK": {
          "type": "text",
          "index": "true"
        }
      }
    }
  EOF
  force_destroy                  = true
  depends_on                     = [aws_opensearchserverless_collection.forex_kb]
}

Thanks @acwwat, it's can work.

Copy link

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-resource Introduces a new resource. service/opensearchserverless Issues and PRs that pertain to the opensearchserverless service.
Projects
None yet
Development

No branches or pull requests

4 participants