Community

Terrafrom + APIv3 Basic Example Not Work

Very simple conf does not work.

  data "profitbricks_location" "loc" {
  name = "de/fra"
  feature = "SSD"
}
# Provider
provider "profitbricks"  {
  username =  
  password =  
  endpoint =  "https://api.profitbricks.com/rest/v3/"
  retries = "10"  
}
# Details of Provider
resource "profitbricks_datacenter" "main" {  
  location = "${data.profitbricks_location.loc.id}"
  description = "datacenter description"
  "name"      = "Data Center Evolvere"  
}

terraform apply

Error refreshing state: 1 error(s) occurred:

* data.profitbricks_location.loc: 1 error(s) occurred:

* data.profitbricks_location.loc: data.profitbricks_location.loc: An error occured while fetching ProfitBricks locations {
  "httpStatus" : 404,
  "messages" : [ {
    "errorCode" : "309",
    "message" : "Resource does not exist"
  } ]
}

 
  • **bold**
  • _italics_
  • `code`
  • ```code block```
  • # Heading 1
  • ## Heading 2
  • > Quote
 

Hello there,

I suspect the issue is with:

endpoint =  "https://api.profitbricks.com/rest/v3/"

that should be:

endpoint =  "https://api.profitbricks.com/cloudapi/v3/"

I think that is the default value for endpoint anyway, so you shouldn't need to override it.

Hopefully that resolves the issue!

Eric