Closed joekohlsdorf closed 3 weeks ago
Hi @joekohlsdorf , could you pass us the provider debug
Hi Joe, The Meraki Terraform Provider is replicating the behavior of our API operations. As you noticed, a requirement for deleting an access policy is having no ports associated with that policy. We try to avoid breaking changes in our API behavior. When we start planning version 2 of Dashboard API (some time in the future - no dates yet), these kind of behavior changes will be taken into consideration.
Removing a port's association with an access policy can be done using meraki_devices_switch_ports
:
resource "meraki_devices_switch_ports" "this_switch_port" {
serial = "XXX"
access_policy_type = "Open"
port_id = 1
}
Hi @obrigg,
In my opinion the current Dashboard API is sufficient, you could give users optional configuration parameters to specify what should be done with the configuration of the ports on destroy
.
An example provider which does this is terracurl, it isn't pretty but it works and it's definitely better than having to change the configuration before being able to destroy
a network.
Thank you for the feedback. I will make sure the relevant team is aware of it. Does this answer your question about the current behavior?
Closed due inactivity.
Describe the bug
Create
meraki_networks_switch_access_policies
Create
meraki_devices_switch_ports
referencing the policyNow try to run
terraform destroy
, you'll get the following response from the API when trying to destroy the access policy after the switch port is destroyed:Expected behavior
destroy
on a switch port should not be a no-op, instead some kind of default configuration which doesn't depend on any other resources is restored. This could also be a security issue because users of the provider might expect access policies to be removed from ports when the ports are destroyed.A user should not be expected to reconfigure the switch ports before being able to destroy a network.
Environment (please complete the following information):