rtizzy / terraform-provider-vultr

This is a terraform provider for the Vultr cloud. This has been forked from the unmaintained version started by @rgl.
Mozilla Public License 2.0
17 stars 3 forks source link

resource vultr_ssh_key: id is a reserved field name for a resource #11

Open casertap opened 6 years ago

casertap commented 6 years ago

Hi, I built the project with go.1.9.1 and I get this error when I try to run the test:

~/go/src/github.com/elricsfate/terraform-provider-vultr master
$ go test                                                                                                                                                                       [21:43:34]
--- FAIL: TestProvider (0.00s)
        provider_test.go:12: err: 1 error(s) occurred:

                * resource vultr_ssh_key: id is a reserved field name for a resource
FAIL
exit status 1
FAIL    github.com/elricsfate/terraform-provider-vultr  0.017s

I get the same error if I try to run: terraform plan on my project.

variable "machine_types" {
  default = [203]
}

resource "vultr_ssh_key" "vultr_key" {
    name = "example created from terraform"
    public_key = "${file("~/.ssh/vultr_rsa.pub")}"
}

#curl https://api.vultr.com/v1/regions/list | python -m json.tool
#curl https://api.vultr.com/v1/plans/list_vc2 | python -m json.tool
#curl https://api.vultr.com/v1/os/list | python -m json.tool
resource "vultr_server" "machines" {
  count = "${length(var.machine_types)}"
  name = "machines.${count.index}"
    hostname = "machines.${count.index}"
    region_id = 19
  plan_id = "${element(var.machine_types, count.index)}"
    os_id = 167
    auto_backups = false
    ipv6 = false
    private_networking = false
    ssh_key_ids = ["${vultr_ssh_key.vultr_key.id}"]
}

Can you help please? I would really like this to work. Thanks for the good work. Cheers