Open
Description
Terraform Version
$ terraform -v
Terraform v1.4.2
on linux_amd64
+ provider registry.terraform.io/maas/maas v1.1.0
Affected Resource(s)
Please list the resources as a list, for example:
- maas_vlan
Terraform Configuration Files
data "maas_fabric" "my_fabric" {
name = "fabric-4"
}
resource "maas_space" "my_space" {
name = "my-space"
}
resource "maas_vlan" "vlan1000" {
fabric = data.maas_fabric.my_fabric.id
vid = 1000
name = "vlan-1000"
space = maas_space.my_space.name
dhcp_on = true
}
resource "maas_subnet" "my_subnet" {
cidr = "10.244.0.0/24"
fabric = data.maas_fabric.my_fabric.id
vlan = maas_vlan.vlan1000.id
name = "my-subnet"
gateway_ip = "10.244.0.1"
dns_servers = [
"8.8.8.8",
"8.8.4.4"
]
ip_ranges {
type = "dynamic"
start_ip = "10.244.0.200"
end_ip = "10.244.0.254"
}
}
Expected Behavior
Terraform's apply succeeds on the first run.
Actual Behavior
The plan fails with the following error:
│ Error: ServerError: 400 Bad Request ({"dhcp_on": ["dhcp can only be turned on when a dynamic IP range is defined."]})
│
│ with maas_vlan.vlan1000,
│ on main.tf line 59, in resource "maas_vlan" "vlan1000":
│ 59: resource "maas_vlan" "vlan1000" {
│
If I set dchp_on = false
, on the first apply, then to true
on the second, it works.
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# maas_vlan.vlan1000 will be updated in-place
~ resource "maas_vlan" "vlan1000" {
~ dhcp_on = false -> true
id = "5010"
name = "vlan-1000"
# (4 unchanged attributes hidden)
}
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Activity