08-13-2024 11:57 AM
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.
08-22-2024 02:01 PM
Hey Zach,
Can you provide the request you're sending and the response you're getting back?
08-22-2024 03:12 PM
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
```
```
08-22-2024 04:14 PM
I see. It sounds like the API is behaving as expected, but Terraform is struggling to handle the response. Is that correct?
08-22-2024 04:17 PM
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
08-26-2024 12:29 PM
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.
08-30-2024 02:53 PM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide