While using PUT /organizations/{organizationId}/appliance/vpn/thirdPartyVPNPeers I encountered a problem where sending duplicate peers in the put request breaks using the downstream Terraform provider. I encountered this while using the Terraform provider and accidentally sent off duplicate values.
While using the endpoint I think I would expect a bad request or conflict error response.
Hey Zach,
Can you provide the request you're sending and the response you're getting back?
Hi Oren,
Sure. As an example
PUT https://api.meraki.com/api/v1/organizations/redacted/appliance/vpn/thirdPartyVPNPeers
with the following body
```
```
to which the endpoint will respond with a 200 OK and the peers array I sent.
Once the duplicate data is in the peers array it will break the response back to terraform with the following error `Error: Duplicate Set Element`
You can see the terraform error by doing a simple data lookup
```
```
I see. It sounds like the API is behaving as expected, but Terraform is struggling to handle the response. Is that correct?
well depends on the view. If you would expect the API to allow for duplicate values, then you would say it is a bug with the Terraform provider handling duplicate values and the terraform provider should fix the handling.
If you don't think the API should allow for duplicate values, then it would be considered a bug with the API and the API should fix the handling of duplicate values
Technically, while the Dashboard (and the API) allow this configuration, having two identical entries wouldn't make sense unless the IDs or availability fields are different.
got it, I opened a github issues on the terraform provider requesting validation be added in case that is where it should be added.
https://github.com/cisco-open/terraform-provider-meraki/issues/153