Git Product home page Git Product logo

terraform-google-lb-http's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-google-lb-http's Issues

Resource google_compute_firewall.default-hc has two "count" arguments

https://github.com/GoogleCloudPlatform/terraform-google-lb-http/blob/b82fc47a848c92e0bbd45d874c2dd6669d200b32/main.tf#L91-L104

This resource has two count arguments defined. It seems that as of Terraform 0.11 this is silently ignored, with Terraform ignoring one of the specifications. A forthcoming Terraform release will make this a real error, as a usability improvement:

Error: Attribute redefined

  on main.tf line 94:
  94:   count         = "${length(var.backend_params)}"

The attribute "count" was already defined at main.tf:92,3-8. Each attribute may be defined only once.

Since this resource is using count.index with both var.firewall_networks and var.backend_params, I'm not sure which one was actually intended here.

option to provision google managed ssl cert(s)

It seems like there is none. In order to integrate Google Managed SSL Certs with this module, they must be created separately. Not a big deal but wondering if it would be easily embeddable into the module

Support reserved IP address

We need to use static IP address in our LB.

Detail of propose is below.

  • Add ip_address variable.
  • Switch count of google_compute_global_address 0 or 1.
  • Use google_compute_global_address.default.address or var.ip_address.

backend service defaults? - so many nulls

Any recommendations on how to not have to repeat null everywhere? This is one group for one service, many others look similar and makes the config really long. e.g.:

      groups = [
        {
          group                        = data.google_compute_network_endpoint_group.foo.self_link
          balancing_mode               = "RATE"
          capacity_scaler              = null
          description                  = null
          max_connections              = null
          max_connections_per_instance = null
          max_connections_per_endpoint = null
          max_rate                     = null
          max_rate_per_instance        = null
          max_rate_per_endpoint        = 100
          max_utilization              = null
        }

Support backend/balancing_mode

Hi !

We wanted to change backend/balancing_mode to RATE but it seems that current version of module doesn't support this option.

I think we will send a PR for that.

Thank you for your work !

Update providers

The provider constraint now restricts terraform to only use 2.7.0. Which is quite old now (21 may 2019)

terraform {
  required_version = "~> 0.12.0"
  required_providers {
    google      = "~> 2.7"
    google-beta = "~> 2.7"
  }
}

Can we update the bundle to use at least 2.20?

Error: Invalid value for module argument

When trying to migrate our configuration to 3.0.0, I ran into a syntax/type error. I tested this using the example from the documentation and it produces the same error:

Error: Invalid value for module argument

  on gclb/main.tf line 35, in module "gce-lb-https":
  35:   backends = {
  36:     default = {
  37:       description                     = null
  38:       protocol                        = "HTTP"
  39:       port                            = 443
  40:       port_name                       = "default-https"
  41:       timeout_sec                     = 10
  42:       connection_draining_timeout_sec = null
  43:       enable_cdn                      = false
  45:       health_check = {
  46:         check_interval_sec  = null
  47:         timeout_sec         = null
  48:         healthy_threshold   = null
  49:         unhealthy_threshold = null
  50:         request_path        = "/"
  51:         port                = 443
  52:         host                = null
  53:       }
  55:       groups = [
  56:         {
  57:           # Each node pool instance group should be added to the backend.
  58:           group                        = var.backend
  59:           balancing_mode               = null
  60:           capacity_scaler              = null
  61:           description                  = null
  62:           max_connections              = null
  63:           max_connections_per_instance = null
  64:           max_connections_per_endpoint = null
  65:           max_rate                     = null
  66:           max_rate_per_instance        = null
  67:           max_rate_per_endpoint        = null
  68:           max_utilization              = null
  69:         },
  70:       ]
  71:     }
  72:   }

The given value is not suitable for child module variable "backends" defined
at
.terraform/modules/lb.gce-lb-https/terraform-google-modules-terraform-google-lb-http-d65708d/variables.tf:62,1-20:
element "default": attribute "protocol": string required.

The error message at the end ("element "default": attribute "protocol": string required.") changes from one attribute to another when I re-run terraform apply:

element "default": attribute "protocol": string required.
element "default": attribute "enable_cdn": bool required.
element "default": attribute "timeout_sec": number required.
element "default": attribute "port": number required.

No matter what the message is, the type always is correct. e.g. in the error above, you see protocol is "HTTP", which is a string.

I've got the latest terraform:

$ terraform --version
Terraform v0.12.18

And I've pinned GoogleCloudPlatform/lb-http/google at version 3.0.0 (clearly because when I try 2.0.0 I get "argument "backend_params" is required" error which makes sense because that syntax changed).

Any ideas where to look on this one? I'm kinda stumped.

cannot rotate generated SSL certificates

When using ssl = true with private_key and certificate (i.e. not BYO ssl_certificates), it is impossible to rotate in a new SSL certificate without manual intervention (i.e. destroying resources with terraform, gcloud, or the GCP Console).

This is because GCP SSL certificates cannot be updated after creation, as documented here.

Trying to do so will yield this sort of output:

Terraform will form the following actions:

-/+ module.gcp-edge-lb.google_compute_ssl_certificate.default (new resource required)
      id:                 "example-certificate" => <computed> (forces new resource)
      certificate:        <sensitive> => <sensitive> (forces new resource)
      certificate_id:     "31415926535" => <computed>
      name:               "example-certificate" => "example-certificate"
      name_prefix:        "" => <computed>
      private_key:        <sensitive> => <sensitive> (forces new resource)
      project:            "my-project" => <computed>
      self_link:          "https://www.googleapis.com/compute/v1/projects/my-project/global/sslCertificates/example-certificate" => <computed>

  ~ module.gcp-edge-lb.google_compute_target_https_proxy.default
      ssl_certificates.#: "1" => <computed>


Plan: 1 to add, 1 to change, 1 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

module.gcp-edge-lb.google_compute_ssl_certificate.default: Creating...
  certificate:    "<sensitive>" => "<sensitive>"
  certificate_id: "" => "<computed>"
  name:           "" => "example-certificate"
  name_prefix:    "" => "<computed>"
  private_key:    "<sensitive>" => "<sensitive>"
  project:        "" => "<computed>"
  self_link:      "" => "<computed>"

Error: Error applying plan:

1 error(s) occurred:

* module.gcp-edge-lb.google_compute_ssl_certificate.default: 1 error(s) occurred:

* google_compute_ssl_certificate.default: Error creating ssl certificate: googleapi: Error 409: The resource 'projects/my-project/global/sslCertificates/example-certificate' already exists, alreadyExists

This is alleviated with a simple change, as described in that same documentation:

  • Use the argument name_prefix instead of name
  • Add a lifecycle block with create_before_destroy = true

4.0 upgrade nodes about log_config are wrong

https://github.com/terraform-google-modules/terraform-google-lb-http/releases/tag/v4.0.0 says

You must now specify log_config for each backend service. Use log_config = null to use the default.

The module expects a map so this will fail:

Error: Invalid function argument

  on .terraform/modules/gce-lb-http/terraform-google-lb-http-4.0.0/main.tf line 124, in resource "google_compute_backend_service" "default":
 124:     enable      = lookup(lookup(each.value, "log_config", {}), "enable", true)
    |----------------
    | each.value is object with 12 attributes

Invalid value for "inputMap" parameter: argument must not be null.


Error: Invalid function argument

  on .terraform/modules/gce-lb-http/terraform-google-lb-http-4.0.0/main.tf line 125, in resource "google_compute_backend_service" "default":
 125:     sample_rate = lookup(lookup(each.value, "log_config", {}), "sample_rate", "1.0")
    |----------------
    | each.value is object with 12 attributes

Invalid value for "inputMap" parameter: argument must not be null.

google_compute_health_check "only one of" error

Environment

Terraform: v0.12.19
terraform-google-lb-http: 4.0.0

Error started happening: May 5th 2020 - 07:00 GMT

google-beta provider: 3.20

Last time working: May 4th 2020 - 16:00 GMT

google-beta provider: 3.19

Error output

Error: "http2_health_check": only one of `http2_health_check,http_health_check,https_health_check,ssl_health_check,tcp_health_check` can be specified, but `http2_health_check,http_health_check,https_health_check` were specified.

  on .terraform/modules/lb_https/terraform-google-lb-http-4.0.0/main.tf line 132, in resource "google_compute_health_check" "default":
 132: resource "google_compute_health_check" "default" {



Error: "http_health_check": only one of `http2_health_check,http_health_check,https_health_check,ssl_health_check,tcp_health_check` can be specified, but `http2_health_check,http_health_check,https_health_check` were specified.

  on .terraform/modules/lb_https/terraform-google-lb-http-4.0.0/main.tf line 132, in resource "google_compute_health_check" "default":
 132: resource "google_compute_health_check" "default" {



Error: "tcp_health_check": only one of `http2_health_check,http_health_check,https_health_check,ssl_health_check,tcp_health_check` can be specified, but `http2_health_check,http_health_check,https_health_check` were specified.

  on .terraform/modules/lb_https/terraform-google-lb-http-4.0.0/main.tf line 132, in resource "google_compute_health_check" "default":
 132: resource "google_compute_health_check" "default" {


Error: "https_health_check": only one of `http2_health_check,http_health_check,https_health_check,ssl_health_check,tcp_health_check` can be specified, but `http2_health_check,http_health_check,https_health_check` were specified.

  on .terraform/modules/lb_https/terraform-google-lb-http-4.0.0/main.tf line 132, in resource "google_compute_health_check" "default":
 132: resource "google_compute_health_check" "default" {

Workaround

Download module to project, and edit the main.tf file.

As long as we are using "http_health_check", on the resource "google_compute_health_check" remove the dynamic "https_health_check" and "http2_health_check" blocks.

diff --git a/main.tf b/main.tf
index bc609ad..913cdc4 100644
--- a/main.tf
+++ b/main.tf
@@ -155,38 +155,6 @@ resource "google_compute_health_check" "default" {
     }
   }

-  dynamic "https_health_check" {
-    for_each = each.value["protocol"] == "HTTPS" ? [
-      {
-        host         = lookup(each.value["health_check"], "host", null)
-        request_path = lookup(each.value["health_check"], "request_path", null)
-        port         = lookup(each.value["health_check"], "port", null)
-      }
-    ] : []
-
-    content {
-      host         = lookup(https_health_check.value, "host", null)
-      request_path = lookup(https_health_check.value, "request_path", null)
-      port         = lookup(https_health_check.value, "port", null)
-    }
-  }
-
-  dynamic "http2_health_check" {
-    for_each = each.value["protocol"] == "HTTP2" ? [
-      {
-        host         = lookup(each.value["health_check"], "host", null)
-        request_path = lookup(each.value["health_check"], "request_path", null)
-        port         = lookup(each.value["health_check"], "port", null)
-      }
-    ] : []
-
-    content {
-      host         = lookup(http2_health_check.value, "host", null)
-      request_path = lookup(http2_health_check.value, "request_path", null)
-      port         = lookup(http2_health_check.value, "port", null)
-    }
-  }
-
 }

 resource "google_compute_firewall" "default-hc" {

Possible explanation

Seems since latest google-beta provider's version the "google_compute_health_check" parameter has been enforced to accept one (and only one) kind of health_check per backend.

Even though each dynamic block is conditioned by a for_each clause, looks like the component is being generated anyways

option to use an existing certificate

We would find it useful to be able to pass in the self_link of an existing certificate to lb-http. This would allow us to create the certificate outside of terraform to avoid having key material in the tfstate file.

I've implemented this feature in our fork: fastly#1

To my understanding, Fastly already has a corporate CLA, and I've been added to it. If this all looks good to you, I'll create a PR.

Incorrect attribute value type

Error: Incorrect attribute value type

  on .terraform/modules/mig2/GoogleCloudPlatform-terraform-google-managed-instance-group-7550567/main.tf line 242, in resource "google_compute_firewall" "default-ssh":
 242:   source_ranges = ["${var.ssh_source_ranges}"]

Inappropriate value for attribute "source_ranges": element 0: string required.

Error: Incorrect attribute value type

  on .terraform/modules/mig2/GoogleCloudPlatform-terraform-google-managed-instance-group-7550567/main.tf line 274, in resource "google_compute_firewall" "mig-health-check":
 274:   target_tags   = ["${var.target_tags}"]

Inappropriate value for attribute "target_tags": element 0: string required.

Unsuitable value for child module variable "backends"

When creating new http-lb, I went to a syntax/type error which is shown as below:

Error: Invalid value for module argument

  on https-lb.tf line 29, in module "gce-lb-https":
  29:   backends = {
  30:     default = {
  31:       description                     = null
  32:       protocol                        = "HTTP/2"
  33:       port                            = 443
  34:       port_name                       = "http2"
  35:       timeout_sec                     = 30
  36:       connection_draining_timeout_sec = 300
  37:       enable_cdn                      = "false"
  38:       session_affinity                = null
  39:       affinity_cookie_ttl_sec         = null
  40:       security_policy                 = google_compute_security_policy.default_rules
  41:       health_check                    = google_compute_https_health_check.https_health_check.id
  43:       log_config = {
  44:         enable = true
  45:         sample_rate = 0.2
  46:       }
  48:       groups = [
  49:         {
  50:           group                        = google_compute_instance_group.my_instance_group.self_link
  51:           balancing_mode               = "UTILIZATION"
  52:           capacity_scaler              = 100
  53:           description                  = null
  54:           max_connections              = null
  55:           max_connections_per_instance = null
  56:           max_connections_per_endpoint = null
  57:           max_rate                     = null
  58:           max_rate_per_instance        = null
  59:           max_rate_per_endpoint        = null
  60:           max_utilization              = 80
  61:         },
  62:       ]
  63:     }
  64:   }

The given value is not suitable for child module variable "backends" defined
at
.terraform/modules/gce-lb-https/terraform-google-lb-http-4.0.0/variables.tf:69,1-20:
element "default": attribute "timeout_sec": number required.

The value timeout_sec in backends.default block is already number.
I tried to plan several times with module version 3.2.0 and 4.0.0, but still got the same error with different values:

element "default": attribute "port_name": string required.
element "default": attribute "port": number required.
element "default": attribute "protocol": string required.
element "default": attribute "health_check": object required.

My terraform version: 0.12.20

Make max utilization optional to support Serverless NEG backends

Similar to what we had to do with health checks to support Internet NEGs, it would appear that serverless NEGs cannot have a max util set.

Error: Error creating BackendService: googleapi: Error 400: Invalid value for field 'resource.backends[0].maxUtilization': '1.0'. Max utilization is not supported for Serverless network endpoint groups., invalid

Feature to ignore changes to backend services

Hi,

I am using the Google LB Terraform module to create an LB with empty backend services that get automatically populated later on by Google's AutoNEG feature: https://github.com/GoogleCloudPlatform/gke-autoneg-controller

The issue here is that backends are created outside of terraform, so when this is done, the next run of Terraform plan intends to destroy them.

It would be nice to have an optional variable for the module to enable ignore_changes for backends specifically to make use of this feature.

Thanks!

TF configuration in use:

module "global-loadbalancer" {
  source  = "GoogleCloudPlatform/lb-http/google"
  version = "3.0.0"
  project = var.project_id
  name    = "global-loadbalancer"

  ssl         = true
  private_key = file("key")
  certificate = file("cert")

  firewall_networks = ["c0"]
  firewall_projects = [var.host_project_id]

  target_tags = []

  url_map        = google_compute_url_map.url-map.self_link
  create_url_map = false

  // We create empty backends to populate them automatically with autoneg feature
  // https://github.com/GoogleCloudPlatform/gke-autoneg-controller
  backends = {

	"frontendapi" = {
	  description                     = null
	  protocol                        = "HTTP"
	  port                            = 8080
	  port_name                       = "http"
	  timeout_sec                     = 10
	  connection_draining_timeout_sec = null
	  enable_cdn                      = false
	  health_check                    = local.health_check
	  groups = []
	}
  }
}

Support plans?

I've come across this useful module, but notices that build is failing for some pipelines.

So is this module still supported and it is ok to use it?

Make logging optional in health_check

Relates to feature introduced via https://github.com/terraform-google-modules/terraform-google-lb-http/pull/98/files

As per https://www.terraform.io/docs/providers/google/r/compute_health_check.html the log_config is optional, however we are required to set it in this terraform-google-lb-http module.

While setting it to null only once could be ok, that is not the case, instead we get

      + log_config {}

upon every terraform apply now.

It would be best to just make it completely optional, perhaps by means of https://www.terraform.io/docs/configuration/expressions.html#dynamic-blocks

Same experience when setting logging to false ... it gets re applied every time.

cc @Dev25

Plan failure when no backend services specified

GCP load balancers can be created solely with backend buckets
instead of backend services. However, that fails. Here's an example:

# bind the bucket `lb-bucket` to a GCP backend_bucket
resource "google_compute_backend_bucket" "testlb-backend-bucket" {
  name        = "testlb-backend-bucket"
  bucket_name = "${google_storage_bucket.my_bucket.name}"
  enable_cdn  = false 
}

# the URL map points to the backend bucket, not a backend service 
resource "google_compute_url_map" "testlb-url-map" {
  name        = "testlb-url-map"
  default_service = "${google_compute_backend_bucket.testlb-backend-bucket.self_link}"
}

module "lbtest-lb" {
  name        = "lbtest-lb"

  source      = "GoogleCloudPlatform/lb-http/google"
  version     = "1.0.5"

  region      = "${var.gcp_region}"

  create_url_map = false
  url_map        = "${google_compute_url_map.testlb-url-map.self_link}"

  # no backend services
  target_tags = []
  backends = {}
  backend_params = []
}

With this setup, terraform plan fails with:

Error: module.lbtest-lb.google_compute_firewall.default-hc: 1 error(s) occurred:

* module.lbtest-lb.google_compute_firewall.default-hc: element: element() may not be used with an empty list in:

${element(split(",", element(var.backend_params, count.index)), 2)}

Since the default-hc will not be created if backend_params is empty,
we just need the expression to parse. Unfortunately, this requires a
tricky expression to work around a HCL issue:
hashicorp/hil#50 (comment)

I used the pipe | character is as delimiter for that trick, because GCP names cannot have pipes.

Backend port number is blank after applying plan

The following code results in no backend port for the load balancer:

module "gce-lb-http" {
  source            = "github.com/GoogleCloudPlatform/terraform-google-lb-http"
  name              = "group-http-lb"
  target_tags       = ["${var.consul_server_cluster_tag_name}"]
  backends          = {
    "0" = [
      { group = "${module.consul_servers.instance_group}" }
    ],
  }
  backend_params    = [
    # health check path, port name, port number, timeout seconds.
    "/v1/status/leader,api,8500,10"
  ]
}

It should result in a backend rule specifying 8500. Only the label, api in this case, actually appears in the console after provisioning.

Integration test suite does not handle project creation failures

If an error occurs while setting up the integration tests, the script apparently tries to delete the project before creating it again, but it doesn't work:

module.project-ci-lb-http.module.project-factory.data.null_data_source.default_service_account: Refreshing state...
module.project-ci-lb-http.module.project-factory.google_project.main: Destroying... [id=ci-int-lb-http-ef72]
module.project-ci-lb-http.module.project-factory.google_project.main: Destruction complete after 4s
module.project-ci-lb-http.module.project-factory.google_project.main: Creating...

Error: error creating project ci-int-lb-http-ef72 (ci-int-lb-http): googleapi: Error 409: Requested entity already exists, alreadyExists. If you received a 403 error, make sure you have the `roles/resourcemanager.projectCreator` permission

I think this happens because Google keeps the project around for a while for "undelete".

To fix this I had to destroy the random number from terraform:

docker run --rm -it -e SERVICE_ACCOUNT_JSON -e TF_VAR_org_id -e TF_VAR_folder_id -e TF_VAR_billing_account -v "$(pwd)":/workspace gcr.io/cloud-foundation-cicd/cft/developer-tools:0.4.2 bash -c 'cd test/setup; /usr/local/bin/execute_with_credentials.sh terraform destroy --target module.project-ci-lb-http.module.project-factory.random_id.random_project_id_suffix'

Then I could re-run the make docker_test_prepare command.

I don't know enough about the test suite. Is this a problem in here or should I post this issue to terraform-google-modules/terraform-google-project-factory?

Allow creation of LB with backend services that are not tied to any actual IG or NEG

I am interested in using https://github.com/GoogleCloudPlatform/gke-autoneg-controller which only requires that backend services be created, but they need not any associated IGs or NEGs (though they could be of one of those types) as the autoneg-controller will handle that.

I would like to confirm that it is indeed possible via this module to achieve the creation of a GCLB with backend services not associated to any IGs or NEGs.

Thanks in advance.

two additional health check ranges need adding to default-hc

google_compute_firewall. default-hc needs two additional health check ranges added:

From a GCP announcement dated Jan 31, 2017:

If you use HTTP(S) Load Balancing or SSL Proxy:

Current behavior: Proxied traffic from the load balancer and the health check probes to
your load balanced instances have source IP addresses in the range 130.211.0.0/22.

Action required: We are introducing an additional range 35.191.0.0/16 for this purpose.
You need to update your firewall rule to allow traffic from this new range (35.191.0.0/16)
in addition to the current range (130.211.0.0/22).

If you use Network Load Balancing:

Current behavior: You are not required to add firewall rules for Network LB health checks today

Action required: We are introducing three new ranges for health checking: 209.85.152.0/22,
209.85.204.0/22, and 35.191.0.0/16. You need to ensure that your firewall allows traffic
from 209.85.152.0/22, 209.85.204.0/22, and 35.191.0.0/16. The health check probes to your
backend instances will come from one of these ranges.

Can't apply module. Failure creating healthchecks

I'm getting the following error when applying the module:

Error: "https_health_check": only one of http2_health_check,http_health_check,https_health_check,ssl_health_check,tcp_health_check can be specified, but http2_health_check,http_health_check,https_health_check were specified.

on .terraform/modules/app_lb/terraform-google-lb-http-4.0.0/modules/dynamic_backends/main.tf line 135, in resource "google_compute_health_check" "default":
135: resource "google_compute_health_check" "default" {

It seems there's been a change with the google provider that now makes this fail.

The backend protocol in my case is "HTTP".

Multiple counts on google_compute_firewall resource

Hello maintainers -

Question: I noticed there are multiple counts on google_compute_firewall.default-hc and wondered if that was intentional? I think in these cases, terraform falls back on the second of two attribute declarations. If the goal is to provide a conditional or fallback, that's probably made more explicit within a single count attribute, no?

Let me know if there was intent behind this decision or if it's in fact a bug. From there we can sort out the desired behavior and get it cleaned up. Thanks for this module! ๐ŸŽŠ

ssl_certificates - ssl & use_ssl_certificates

Is it ever desirable to set ssl_certificates but keep use_ssl_certificates to false?
Is it ever desirable to set ssl_certificates but keep ssl to false?

If not, it might be best to implicitly enable ssl and use_ssl_certificates if ssl_certificates is set.

Instance groups from multi zone cluster

Please correct me if wrong, but the readme basically takes the first instance group from an existing cluster and configures the load balancer to use this as the backend in a backend service.
Note - I was following the example here as a basis to work from.

As is, will this module support multi zone clusters? i.e. a cluster that has say 3 instance groups. Given the output from the google_container_cluster is a list here, im not sure how I can go about iternating over that particular list within the backends segment of this load balancer. i.e.

  backends = {
    "0" = [
      {
        # Each node pool instance group should be added to the backend.
        group = "${var.backend}"
      },
    ]
  }

I could manually add numbers from the list, eg. if the output was called: TARGET_GROUP_URLS
I could do the following:

  backends = {
    "0" = [
      {
        # Each node pool instance group should be added to the backend.
        group = "${var.TARGET_GROUP_URLS[0]}"
        group = "${var.TARGET_GROUP_URLS[1]}"
        group = "${var.TARGET_GROUP_URLS[2]}"
      },
    ]
  }

However if my cluster may have many node pools, I may not know the end number of target groups. So the above would work but only if I know exactly the number of URLS to expect.

Is there any way to populate recursively using count based on the length of the the var?
Or am I missing something and I don't need to provide all the instance group urls specifically?

Can't delete an instance groups created by the GKE worker node pool that's in use by a backend service

I'm using the terraform to manage the GKE cluster setup. I want to update the instance size of the worker nodes that would re-create google_container_node_pol. But that steps failing because below error because instance groups attached with GCP LB backend not detaching by terraform.

oogle_container_node_pool.new_container_cluster_node_pool.0: Error waiting for deleting GKE NodePool:
(1) Google Compute Engine: The instance_template resource 'projects/XXX-XXX-XXXX/global/instanceTemplates/gke-XXX-XXX-us-west-XXXXXX-53369325' is already being used by 'projects/XXXX-XXXX-XXXXX/zones/us-west1-b/instanceGroupManagers/gke-XXXXX-XXXX-us-west-XXXXX-XXXXX-us-west-53369325-grp'

Finally, we have to manually remove the instance groups entries from GCP LB backend, plan and apply again to re-create the node pool with new instance type.

HTTPS backend not available

I'm trying to setup HTTPS backend configuration with :

backend_protocol = "HTTPS"

But i got this error :

The module works when i don't specify backend_protocol, but with the default value (HTTP)
Am I doing it the wrong way ?

healthcheck interval

There is no variable for check_interval_sec (google_compute_http_health_check), so it's not possible to adjust interval.

Relax version constraints

Currently, the google provider required is:

google      = "~> 2.15"
google-beta = "~> 2.15"

Which is pretty old, it was released on Sep 18, 2019.
The latest version is already 3.3, can you please upgrade the versions.tf to use the latest version?

Fail to verifying example `multiple-certs`

Instances created in us-central1 region doesn't responds properly:

$ curl -sfkL "https://34.102.207.91/group1" | grep zones
          <td>projects/698653867196/zones/us-west1-a</td>
$ curl -sfkL "https://34.102.207.91/group3" | grep zones
          <td>projects/698653867196/zones/us-east1-d</td>
$ curl -k "https://34.102.207.91/group2/"

<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>502 Server Error</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Server Error</h1>
<h2>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.</h2>
<h2></h2>
</body></html>

log_config can't be disabled

I'm tryng to create a load balancer and set:

log_config {
  enable = false
  sample_rate = null
}

The configuration doesn't work correctly as it is always set to enable->true sample_rate->1

I can see this in the logs

2020-03-18T12:45:50.787+0100 [DEBUG] plugin.terraform-provider-google-beta_v3.13.0_x5:   },
2020-03-18T12:45:50.787+0100 [DEBUG] plugin.terraform-provider-google-beta_v3.13.0_x5:   "logConfig": {
2020-03-18T12:45:50.787+0100 [DEBUG] plugin.terraform-provider-google-beta_v3.13.0_x5:     "enable": true,
2020-03-18T12:45:50.787+0100 [DEBUG] plugin.terraform-provider-google-beta_v3.13.0_x5:     "sampleRate": 1
2020-03-18T12:45:50.787+0100 [DEBUG] plugin.terraform-provider-google-beta_v3.13.0_x5:   },
2020/03/18 12:45:50 [WARN] Provider "registry.terraform.io/-/google-beta" produced an unexpected new value for module.app_lb.google_compute_backend_service.default["default"], but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .log_config[0].enable: was cty.False, but now cty.True
      - .log_config[0].sample_rate: was null, but now cty.NumberIntVal(1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.