Skip to content

can't use iam user as master_user_arn #18

Closed
@dim-ops

Description

@dim-ops

Description

I don't understand why this code doesn't work:

  advanced_security_options = {
    enabled                        = true
    anonymous_auth_enabled         = false
    internal_user_database_enabled = false

    master_user_options = {
      master_user_arn     = aws_iam_user.opensearch_cluster[each.key].arn
    }
  }

My error:
creating OpenSearch Domain: ValidationException: If you don’t enable the internal user database, you must provide a master user ARN.

If I remove master_user_options block, it's work because my own user it's used

When I modify module

master_user_arn = try(master_user_options.value.master_user_arn, null) == null ? try(master_user_options.value.master_user_arn, data.aws_iam_session_context.current[0].issuer_arn) : null

by

master_user_arn = master_user_options.value.master_user_arn

it works

  • ✋ I have searched the open/closed issues and my issue is not listed.

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists ✅

Versions

  • Module version [Required]:
    ~> 1.0
  • Terraform version:
    ~> 1.0
  • Provider version(s):
    ~> 5.0

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