Closed totik234 closed 2 months ago
Ловим аналогичную ошибку (версия провайдера -- 0.117.0):
$ terraform apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# yandex_mdb_postgresql_cluster.pg-cluster-test will be created
+ resource "yandex_mdb_postgresql_cluster" "pg-cluster-test" {
+ created_at = (known after apply)
+ deletion_protection = (known after apply)
+ environment = "PRODUCTION"
+ folder_id = (known after apply)
+ health = (known after apply)
+ host_group_ids = (known after apply)
+ host_master_name = (known after apply)
+ id = (known after apply)
+ labels = (known after apply)
+ name = "test"
+ network_id = (known after apply)
+ security_group_ids = (known after apply)
+ status = (known after apply)
+ config {
+ autofailover = (known after apply)
+ backup_retain_period_days = (known after apply)
+ postgresql_config = (known after apply)
+ version = "14"
+ disk_size_autoscaling {
+ disk_size_limit = 50
+ emergency_usage_threshold = 90
+ planned_usage_threshold = 70
}
+ resources {
+ disk_size = 16
+ disk_type_id = "network-ssd"
+ resource_preset_id = "s2.micro"
}
}
+ host {
+ fqdn = (known after apply)
+ replication_source = (known after apply)
+ role = (known after apply)
+ subnet_id = (known after apply)
+ zone = "ru-central1-a"
}
+ maintenance_window {
+ day = "SAT"
+ hour = 12
+ type = "WEEKLY"
}
}
# yandex_vpc_network.network-test will be created
+ resource "yandex_vpc_network" "network-test" {
+ created_at = (known after apply)
+ default_security_group_id = (known after apply)
+ folder_id = (known after apply)
+ id = (known after apply)
+ labels = (known after apply)
+ name = (known after apply)
+ subnet_ids = (known after apply)
}
# yandex_vpc_subnet.subnet-test will be created
+ resource "yandex_vpc_subnet" "subnet-test" {
+ created_at = (known after apply)
+ folder_id = (known after apply)
+ id = (known after apply)
+ labels = (known after apply)
+ name = (known after apply)
+ network_id = (known after apply)
+ v4_cidr_blocks = [
+ "10.5.0.0/24",
]
+ v6_cidr_blocks = (known after apply)
+ zone = "ru-central1-a"
}
Plan: 3 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
yandex_vpc_network.network-test: Creating...
yandex_vpc_network.network-test: Creation complete after 2s [id=enph7slsn081a675j1f4]
yandex_vpc_subnet.subnet-test: Creating...
yandex_vpc_subnet.subnet-test: Creation complete after 1s [id=e9bd6sqa2re74ca5fhgd]
yandex_mdb_postgresql_cluster.pg-cluster-test: Creating...
╷
│ Error: Error while requesting API to create PostgreSQL Cluster: server-request-id = 5847e7e2-73ef-4131-a91e-50c393e98d22 server-trace-id = cf88da70b1e31be5:9f2694499f52559b:cf88da70b1e31be5:1 client-request-id = 081569ec-2526-4a0a-8822-20ad8fcf270d client-trace-id = 47f18a53-56f0-439e-b2eb-01c0813b2914 rpc error: code = InvalidArgument desc = If planned usage threshold is set maintenance window must be specified.
│
│ with yandex_mdb_postgresql_cluster.pg-cluster-test,
│ on main.tf line 1, in resource "yandex_mdb_postgresql_cluster" "pg-cluster-test":
│ 1: resource "yandex_mdb_postgresql_cluster" "pg-cluster-test" {
│
╵
Привет! Да, это баг. Обсудим в команде как лучше его поправить: либо в самом api, либо в провайдере. Спасибо, что написали.
Привет! Поправили в 958ad46 и 3c5e0ff. Выйдет в новой версии провайдера.
Ошибка при создании PostgreSQL Cluster с параметром planned_usage_threshold
Пример конфигурации
Так же если создать кластер без
planned_usage_threshold
, а потом его добавить все отрабатывает.