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

v1.18.107版本创建es实例的时候kibana公网配置失效,并且配置参数OPEN无法识别 #2716

Open
troyqu opened this issue Jul 10, 2024 · 0 comments

Comments

@troyqu
Copy link

troyqu commented Jul 10, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

 tf -version
Terraform v1.8.4
on darwin_amd64

Your version of Terraform is out of date! The latest version
is 1.9.1. You can update by downloading from https://www.terraform.io/downloads.html

Affected Resource(s)

  • tencentcloud_elasticsearch_instance

Terraform Configuration Files

terraform {
  required_providers {
    tencentcloud = {
      source = "tencentcloudstack/tencentcloud"
      version = ">=1.61.5"
    }
  }
}


variable "configData" {
  type = any
}

variable "external_resource" {
  type = any
  default = {}
}

variable "internal_resource" {
  type = any
  default = {}
}

locals {
  depend_resource = merge(var.external_resource, var.internal_resource)
}


resource "tencentcloud_elasticsearch_instance" "items" {
  #Required
  availability_zone = var.configData.availability_zone
  instance_name = var.configData.instance_name
  password = var.configData.password
  version = var.configData.version

  # external require arguments
  vpc_id = try(local.depend_resource[var.configData.vpc_id], var.configData.vpc_id)
  subnet_id = try(local.depend_resource[var.configData.subnet_id], var.configData.subnet_id)

  # Optional
  basic_security_type = var.configData.basic_security_type
  charge_type = var.configData.charge_type
  charge_period = var.configData.charge_period # only work when charge_type=PREPAID
  deploy_mode = var.configData.deploy_mode # 0:单可用区 1:多可用区
  kibana_public_access = var.configData.kibana_public_access # "OPEN": "CLOSE"
  license_type = var.configData.license_type
  renew_flag = var.configData.renew_flag # RENEW_FLAG_MANUAL:手动续费, RENEW_FLAG_AUTO:自动续费, RENEW_FLAG_NOTIFY_AUTO:自动续费(仅对预付费实例生效)
  tags = var.configData.tags

  dynamic es_acl {
    for_each = var.configData.es_acl
    content {
      black_list = es_acl.value.black_list
      white_list = es_acl.value.white_list
    }
  }

  dynamic multi_zone_infos {
    for_each = var.configData.multi_zone_infos
    content {
      availability_zone = multi_zone_infos.value.availability_zone
      subnet_id = try(local.depend_resource[multi_zone_infos.value.subnet_id], multi_zone_infos.value.subnet_id)
    }
  }

  dynamic node_info_list {
    for_each = var.configData.node_info_list
    content {
      disk_size = node_info_list.value.disk_size
      disk_type = node_info_list.value.disk_type
      node_num = node_info_list.value.node_num
      node_type = node_info_list.value.node_type
      type = node_info_list.value.type
      encrypt = node_info_list.value.encrypt
    }
  }

  dynamic web_node_type_info {
    for_each = var.configData.web_node_type_info
    content {
      node_num = web_node_type_info.value.node_num
      node_type = web_node_type_info.value.node_type
    }
  }

}

output "result" {
  value = {
    summary = merge([for k, v in flatten([
      tencentcloud_elasticsearch_instance.items]) : {
      join("/", compact([
        var.configData.instance_name])) = try([
        tencentcloud_elasticsearch_instance.items][k].id, null)
    }]...)

    detail = flatten([
      merge([for k, v in flatten([
        tencentcloud_elasticsearch_instance.items]) :  {
        format("%s", "type") = "es",
        format("%s", "name") = try(var.configData.instance_name, null),
      }
      ]...)])
  }
}

Debug Output

https://gist.github.com/swallretu/e84cb3e0ad50d2f729a105613d998e88

Panic Output

https://gist.github.com/swallretu/09624abda1b4bf817bec1431aa8a9bb8

Expected Behavior

1.创建es实例成功
2.es属性正常(网络控制,标签等)
3.无任何异常output

Actual Behavior

1.创建es实例成功
2.es访问控制中白名单列表缺失部分ip,并且无标签属性
3.控制台有异常输出(输出内容参考Panic output)

图片展示
p1
p2

Steps to Reproduce

  1. terraform apply

Important Factoids

几个奇怪现象说明下:

1.最终output提示kibanapublicaccess参数不正确但是实例创建成功了。
2.kibanapublicaccess参数根据apply的output来看是正确的,和文档描述的数据类型和字段值都一样,但是程序提示有问题。
3.标签信息和es_acl中的白名单信息根据output来看是正确的,但是创建出的实例没有参数信息。

以上是一些疑惑。

References

latest tencentcloud provider es instance docs

  • #0000
@troyqu troyqu changed the title 创建es 实例的时候kibana公网配置失效,并且配置参数OPEN无法识别 v1.18.107版本创建es实例的时候kibana公网配置失效,并且配置参数OPEN无法识别 Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant