linode / terraform-provider-linode

Terraform Linode provider
https://www.terraform.io/docs/providers/linode/
Mozilla Public License 2.0
197 stars 94 forks source link

Argument `linode_id` from resource `linode_nodebalancer` is not expected there #308

Closed mihneastaub closed 3 years ago

mihneastaub commented 3 years ago

Terraform Version

v0.13.6

❯ terraform -v Terraform v0.13.6

Effected Resource(s)

Terraform Configuration Files

resource "linode_nodebalancer" "test-nb" {
    region                      = var.region
    label                         = var.label
    client_conn_throttle = var.client_conn_throttle
    tags                          = var.tags
    linode_id                  = var.linode_id
}

Debug Output

Error: Unsupported argument

on main.tf line 6, in resource "linode_nodebalancer" "infracode-nb": 6: linode_id = var.linode_id

An argument named "linode_id" is not expected here.

Expected Behavior

To map a linode_id to the NodeBalancer.

LBGarber commented 3 years ago

Hello!

Thanks for the report! It looks like our NodeBalancer resource documentation is currently incorrect. In order to attach a Linode to a NodeBalancer, you can do something like this:

resource "linode_nodebalancer" "test-nb" {
  label = var.label
  region = var.region
  client_conn_throttle = var.client_conn_throttle
  tags = var.tags
}

resource "linode_nodebalancer_config" "test-nb-config" {
  nodebalancer_id = linode_nodebalancer.test-nb.id

  port = 80
  protocol = "http"
}

resource "linode_nodebalancer_node" "test-nb-node" {
  nodebalancer_id = linode_nodebalancer.test-nb.id
  config_id = linode_nodebalancer_config.test-nb-config.id

  address = "private_ip_of_linode:80"
  label = "test-nb-node"
}

You can also see our linode_nodebalancer_node resource docs and our NodeBalancer API docs. Let us know if you run into any other problems! :smile:

mihneastaub commented 3 years ago

Hello,

Thank you very much for the Information!

I will close the issue.