timeweb-cloud / terraform-provider-timeweb-cloud

Timeweb Cloud Terraform Provider
47 stars 2 forks source link

Ошибка запроса конфигуратора #2

Closed morggoth closed 1 year ago

morggoth commented 1 year ago

Здравствуйте.

При запросе datasource`а twc_configurator возникает ошибка, если в параметр location передать ru-2, pl-1, kz-1 :

terraform {
  required_providers {
    twc = {
      source = "tf.timeweb.cloud/timeweb-cloud/timeweb-cloud"
    }
  }
  required_version = ">= 0.13"
}

data "twc_configurator" "example-configurator" {
  location = "kz-1"
  disk_type = "nvme"
  cpu_frequency = "3.3"
}
morggoth@hyperion  ~/wk/p/tw-infra  terraform plan 
data.twc_configurator.example-configurator: Reading...

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: no Configurators with provided properties found
│ 
│   with data.twc_configurator.example-configurator,
│   on main.tf line 10, in data "twc_configurator" "example-configurator":
│   10: data "twc_configurator" "example-configurator" {
│ 
╵
 ✘ morggoth@hyperion  ~/wk/p/tw-infra  

При выборе параметра ru-1 все отрабатывает без проблем:

 morggoth@hyperion  ~/wk/p/tw-infra  terraform plan 
data.twc_configurator.example-configurator: Reading...
data.twc_configurator.example-configurator: Read complete after 0s [id=11]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.
 morggoth@hyperion  ~/wk/p/tw-infra  

Используемое окружение:

 morggoth@hyperion  ~/wk/p/tw-infra  terraform version
Terraform v1.4.3-dev
on darwin_arm64
+ provider tf.timeweb.cloud/timeweb-cloud/timeweb-cloud v0.0.7
timeweb-cloud commented 1 year ago

Здравствуйте!

Дело в том, что в настоящее время нет конфигураторов, которые полностью соответствуют указанной спецификации.

Актуальный список тарифов со всеми параметрами можно запросить в API:

export TWC_TOKEN="..." # приватный API-ключ из панели управления
curl -X GET \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TWC_TOKEN" "https://api.timeweb.cloud/api/v1/configurator/servers" | jq .

Спасибо за подробное описание!