terraform-provider-hcloud icon indicating copy to clipboard operation
terraform-provider-hcloud copied to clipboard

[Bug]:

Open carcoco opened this issue 3 years ago • 1 comments

What happened?

The example usage in this page is incorrect: https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs

The 'token' value is not good.

INCORRECT # Configure the Hetzner Cloud Provider provider "hcloud" { token = var.hcloud_token }

CORRECT # Configure the Hetzner Cloud Provider provider "hcloud" { token = "${var.hcloud_token}" }

What did you expect to happen?

Please correct the example.

Please provide a minimal working example

This is a correct example of use:

# Set the variable value in *.tfvars file
# or using the -var="hcloud_token=..." CLI option
variable "hcloud_token" {}

# Configure the Hetzner Cloud Provider
provider "hcloud" {
  token = "${var.hcloud_token}"
}

# Create a server
resource "hcloud_server" "web" {
  # ...
}

carcoco avatar Feb 23 '22 20:02 carcoco

@carcoco IIRC that's an issue if you use a quite old terraform release. If you upgrade to a contemporary release (v1.1.16 is the latest stable one) it will work

phaer avatar Feb 25 '22 12:02 phaer

As @phaer said, this was added in Terraform v0.12.0: https://github.com/hashicorp/terraform/releases/tag/v0.12.0 which was released over 3 years ago.

Going to close this issue as it works as intended. Please feel free to reopen the issue or create a new one if you still have issues.

apricote avatar Nov 21 '22 14:11 apricote