Closed tonejito closed 9 months ago
I tried to create a new zone without specifying the template and I got a 400 error. So I believe the configuration
=> template
attribute is required, not optional.
This is the content of my main.tf
file where I commented the configuration template attribute:
terraform {
required_providers {
ovh = {
source = "ovh/ovh"
}
}
}
provider "ovh" {
endpoint = "ovh-ca"
application_key = "xxxxxxxxxxxxxxxx"
application_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
consumer_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
data "ovh_me" "myaccount" {}
data "ovh_order_cart" "mycart" {
ovh_subsidiary = data.ovh_me.myaccount.ovh_subsidiary
}
data "ovh_order_cart_product_plan" "zone" {
cart_id = data.ovh_order_cart.mycart.id
price_capacity = "renew"
product = "dns"
plan_code = "zone"
}
resource "ovh_domain_zone" "domain_zone" {
ovh_subsidiary = data.ovh_order_cart.mycart.ovh_subsidiary
plan {
plan_code = data.ovh_order_cart_product_plan.zone.plan_code
duration = data.ovh_order_cart_product_plan.zone.selected_price.0.duration
pricing_mode = data.ovh_order_cart_product_plan.zone.selected_price.0.pricing_mode
configuration {
label = "zone"
value = "zone.example.com"
}
# configuration {
# label = "template"
# value = "minimized"
# }
}
}
This is the output of my failed terraform apply
attempt:
% terraform apply
data.ovh_me.myaccount: Reading...
data.ovh_me.myaccount: Read complete after 0s [id=somebody@example.com]
data.ovh_order_cart.mycart: Reading...
data.ovh_order_cart.mycart: Read complete after 0s [id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx]
data.ovh_order_cart_product_plan.zone: Reading...
data.ovh_order_cart_product_plan.zone: Read complete after 1s [id=zone]
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:
# ovh_domain_zone.domain_zone will be created
+ resource "ovh_domain_zone" "domain_zone" {
+ dnssec_supported = (known after apply)
+ has_dns_anycast = (known after apply)
+ id = (known after apply)
+ last_update = (known after apply)
+ name = (known after apply)
+ name_servers = (known after apply)
+ order = (known after apply)
+ ovh_subsidiary = "WE"
+ urn = (known after apply)
+ plan {
+ duration = "P1Y"
+ plan_code = "zone"
+ pricing_mode = "default"
+ configuration {
+ label = "zone"
+ value = "zone.example.com"
}
}
}
Plan: 1 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
ovh_domain_zone.domain_zone: Creating...
╷
│ Error: Could not order domain zone: "calling Post /order/cart/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/checkout:
│ "OVHcloud API error (status code 400): Client::BadRequest: "template not found"
│ (X-OVH-Query-Id: CA.ext-a.bbbbbbbb.ccccc.dddddddddddddddddddddddddddddddd)""
│
│ with ovh_domain_zone.domain_zone,
│ on main.tf line 29, in resource "ovh_domain_zone" "domain_zone":
│ 29: resource "ovh_domain_zone" "domain_zone" {
│
Documentation link
Description
The
ovh_domain_zone
resource has a field namedconfiguration
. The docs page says the following:The code example looks like this, but the documentation does not mention what does
configuration
stands for, or the availabletemplate
names to use.I created an
ovh_domain_zone
resource and I got a bunch of DNS records bundled in without declaration.I assume those records are part of the template, but I could not find their definition in the docs or API.