Report this

What is the reason for this report?

Create Spaces bucket with Terraform gives malformed request

Posted on May 15, 2020

I want to create a space bucket using Terraform. Here is my attempt:

provider "digitalocean" {
  token = var.do_token
  spaces_access_id = var.do_spaces_client_id
  spaces_secret_key = var.do_spaces_secret_key
}

resource "digitalocean_spaces_bucket" "shop_images" {
  name = "shop_images"
  region = var.do_region
  acl = "public-read"
}

The token and spaces client id/secret key work as I can create droplet but not spaces. The do_region variable is fra1.

The error I get in return is:

digitalocean_spaces_bucket.shop_images: Creating...
2020/05/15 09:51:43 [DEBUG] digitalocean_spaces_bucket.shop_images: apply errored, but we're indicating that via the Error pointer rather than returning it: Error creating Spaces bucket: InvalidRequest: Malformed request
        status code: 400, request id: , host id: 
2020/05/15 09:51:43 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2020/05/15 09:51:43 [TRACE] EvalMaybeTainted: digitalocean_spaces_bucket.shop_images encountered an error during creation, so it is now marked as tainted
2020/05/15 09:51:43 [TRACE] <root>: eval: *terraform.EvalWriteState
2020/05/15 09:51:43 [TRACE] EvalWriteState: removing state object for digitalocean_spaces_bucket.shop_images
2020/05/15 09:51:43 [TRACE] <root>: eval: *terraform.EvalApplyProvisioners
2020/05/15 09:51:43 [TRACE] EvalApplyProvisioners: digitalocean_spaces_bucket.shop_images has no state, so skipping provisioners
2020/05/15 09:51:43 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2020/05/15 09:51:43 [TRACE] EvalMaybeTainted: digitalocean_spaces_bucket.shop_images encountered an error during creation, so it is now marked as tainted
2020/05/15 09:51:43 [TRACE] <root>: eval: *terraform.EvalWriteState
2020/05/15 09:51:43 [TRACE] EvalWriteState: removing state object for digitalocean_spaces_bucket.shop_images
2020/05/15 09:51:43 [TRACE] <root>: eval: *terraform.EvalIf
2020/05/15 09:51:43 [TRACE] <root>: eval: *terraform.EvalIf
2020/05/15 09:51:43 [TRACE] <root>: eval: *terraform.EvalWriteDiff
2020/05/15 09:51:43 [TRACE] <root>: eval: *terraform.EvalApplyPost
2020/05/15 09:51:43 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: Error creating Spaces bucket: InvalidRequest: Malformed request
        status code: 400, request id: , host id: 
2020/05/15 09:51:43 [ERROR] <root>: eval: *terraform.EvalSequence, err: Error creating Spaces bucket: InvalidRequest: Malformed request
        status code: 400, request id: , host id: 
2020/05/15 09:51:43 [TRACE] [walkApply] Exiting eval tree: digitalocean_spaces_bucket.shop_images
2020/05/15 09:51:43 [TRACE] vertex "digitalocean_spaces_bucket.shop_images": visit complete
2020/05/15 09:51:43 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping
2020/05/15 09:51:43 [TRACE] dag/walk: upstream of "provider.digitalocean (close)" errored, so skipping
2020/05/15 09:51:43 [TRACE] dag/walk: upstream of "root" errored, so skipping
2020/05/15 09:51:43 [TRACE] statemgr.Filesystem: not making a backup, because the new snapshot is identical to the old
2020/05/15 09:51:43 [TRACE] statemgr.Filesystem: no state changes since last snapshot
2020/05/15 09:51:43 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate

I have no clue what is blocking here.

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.