Skip to content

INFO: You might have to give your opensearch provider a region #102

@bkocik

Description

@bkocik

Hi Alexa - Suneel suggested I fill you in here on the solution to our weird issue with creating a vector index on the OSS collection. I'm the engineer in Yahoo Finance that was struggling with this. We ended up finding our answer on Reddit, which was that you have to give the opensearch provider configuration an aws_region parameter. Prior to doing that, the error we were seeing was this:

module.news_qa_kb_html_agent.module.oss_knowledgebase[0].opensearch_index.vector_index[0]: Creating...
╷
│ Error: elastic: Error 403 (Forbidden): OpenSearch exception [type=authorization_exception, reason=User does not have permissions for the requested resource] [type=security_exception]
│ 
│   with module.news_qa_kb_html_agent.module.oss_knowledgebase[0].opensearch_index.vector_index[0],
│   on .terraform/modules/news_qa_kb_html_agent.oss_knowledgebase/main.tf line 123, in resource "opensearch_index" "vector_index":
│  123: resource "opensearch_index" "vector_index" {

Filing this purely for your own information. We resolved the issue by adding the region:

provider "opensearch" {
  url         = module.news_qa_kb_html_agent.default_collection.collection_endpoint
  healthcheck = false
  aws_region  = var.region
}

I don't know what's unique about our situation that required this, but it worked. Here's the Reddit post that clued us in: https://www.reddit.com/r/Terraform/comments/1icmq16/comment/ma18vrt/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions