cloudposse / terraform-aws-elasticsearch

Terraform module to provision an Elasticsearch cluster with built-in integrations with Kibana and Logstash.
https://cloudposse.com/accelerate
Apache License 2.0
218 stars 231 forks source link

An argument named "advanced_options" is not expected here. (TF: v1.0.3) #111

Closed rimiti closed 2 years ago

rimiti commented 3 years ago

Hi πŸ‘‹ ,

it seems that on Terraform v1.0.3 the variable advanced_options isn't "expected".

β”‚ Error: Unsupported argument
β”‚
β”‚   on main.tf line 302, in module "elk":
β”‚  302:   advanced_options = {
β”‚
β”‚ An argument named "advanced_options" is not expected here.

Module:

module "elasticsearch" {
  source = "cloudposse/elasticsearch/aws"
  version                                         = "0.33.0"
  namespace                       = var.namespace
  stage                           = var.environment
  name                            = var.name
  dns_zone_id                     = var.dns_zone_id
  security_groups                 = var.security_groups
  vpc_id                          = var.vpc_id
  subnet_ids                      = var.subnet_ids
  create_iam_service_linked_role  = var.create_iam_service_linked_role
  zone_awareness_enabled          = var.zone_awareness_enabled
  elasticsearch_version           = var.elastic_search_version
  instance_type                   = var.instance_type
  instance_count                  = var.instance_count
  ebs_volume_size                 = var.ebs_volume_size
  iam_role_arns                   = var.iam_roles
  iam_actions                     = var.iam_actions
  encrypt_at_rest_enabled         = var.encrypt_at_rest_enabled
  kibana_subdomain_name           = var.kibana_subdomain_name

  advanced_options = {
    "rest.action.multi.allow_explicit_index" = "true"
  }
}

main.tf

module "elk" {
  source                      = "../modules/elk"

  name                            = "elk"
  dns_zone_id                     = module.route53_zone.id
  vpc_id                          = module.network.vpc_id
  subnet_ids                      = [module.network.public_subnets_id]
  elasticsearch_version           = "7.4"
  instance_type                   = "t3.small.elasticsearch"
  encrypt_at_rest_enabled         = true
  kibana_subdomain_name           = "kibana"
  create_iam_service_linked_role  = false

  advanced_options = {
    "rest.action.multi.allow_explicit_index" = "true"
  }
}
nitrocode commented 2 years ago

@rimiti not sure where the elk module is. Can you show the source of that ? Does that have the advanced_options input var ? It looks like it's pointing to a local source.

This upstream module contains advanced_options input in variables.tf and shows usage of this in the example which is tested in every PR via terratest.

https://github.com/cloudposse/terraform-aws-elasticsearch/blob/c04e16c075129b4170684c194d65f57dcff894b9/examples/complete/main.tf#L47-L49