Report this

What is the reason for this report?

What custom token scopes do I need to set a loadbalancer forwarding_rule via terraform?

Posted on May 10, 2024

I’m trying to set up a new scoped token to replace a full-access token I previously used for deployment.

I get the following error on terraform plan:

Error building Load Balancer forwarding rules - error: 
&godo.ErrorResponse{Response:(*http.Response)(0xc0005e0f30), 
Message:"You are not authorized to perform this operation", RequestID:"...", Attempts:0}

My token has all scopes enabled for the load_balancer (delete, update, read, create).

My Terraform looks like this:

resource "digitalocean_loadbalancer" "loadbalancer" {
  name = "${var.project_name}-loadbalancer"
  region = "${var.region}"

  forwarding_rule {
    entry_port = 80
    entry_protocol = "http"

    target_port = 80
    target_protocol = "http"
  }

  forwarding_rule {
    entry_port = 443
    entry_protocol = "https"

    target_port = 80
    target_protocol = "http"
  }

P.S I’m very happy that DO now has scoped tokens, this was my biggest problem with the platform until now.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.