这是indexloc提供的服务,不要输入任何密码
Skip to content

FR: make fields of health_check optional #153

@daisy1754

Description

@daisy1754

Currently all fields of mig.healthcheck is mandatory so one has to write a config below:

module "mig" {
  source                  = "terraform-google-modules/vm/google//modules/mig"
  version                 = "1.3.0"
  ...
  health_check = {
    type                = "http"
    initial_delay_sec   = 30
    check_interval_sec  = 5
    timeout_sec         = 5
    healthy_threshold   = 1
    unhealthy_threshold = 5
    response            = ""
    proxy_header        = "NONE"
    port                = 80
    request             = ""
    request_path        = "/"
    host                = ""
  }
}

It's quite verbose compared to plain google_compute_health_check which will be like

resource "google_compute_health_check" "my-service-http-health" {
  provider = google-beta
  name     = "my-service-http-health"

  initial_delay_sec   = 30
  check_interval_sec  = 5
  timeout_sec         = 5
  healthy_threshold   = 1
  unhealthy_threshold = 5

  http_health_check {
    port         = var.image_port
    request_path = "/healthz"
  }
}

It would be great if modules/mig can set sane default and make params optional

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3medium priority issuesenhancementNew feature or requesttriagedScoped and ready for workupstreamWork required on Terraform core or provider

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions