Hello,
We have been trying to utilize the Terraform Meraki Provider, to help us programmatically obtain various information on our devices to utilize across other services.
Generally, this goes alright, however, there are sometimes 2 major problems:
1. Getting Organization Information through a Data Lookup, results in failures and stops the flow for the rest of the information.
This happens randomly, and the code we are using is:
# Data source to retrieve all Meraki organizations
data "meraki_organizations" "orgs" {}
# Data source to retrieve all Meraki devices for the first organization
data "meraki_devices" "all_devices" {
organization_id = data.meraki_organizations.orgs.items[0].id
}
produces the following error in Meraki:
╷
│ Error: Failure when executing GetOrganizations
│
│ with data.meraki_organizations.orgs,
│ on network-zones-offices.tf line 20, in data "meraki_organizations" "orgs":
│ 20: data "meraki_organizations" "orgs" {}
│
│ error with operation GetOrganizations
I am not sure I understand the cause here, as the API Key is valid, and this error appears randomly. How can we future proof this and prevent it from occurring again? Of course we could hardcode an Org ID, but, we would prefer this information not be hardcoded so we can utilize it across multiple tenancies (if needed).
2. When the above doesn't fail, and everything works successfully, we have a massive TF file working, that obtains all of our IP Addresses for all of our Uplinks, but, we are trying to add Virtual IP Address information into that, and it seems to always fail with this error:
data "meraki_networks_appliance_warm_spare" "warm_spare" {
for_each = toset([
for network_id in keys(local.appliances_by_network_id) :
network_id if try(
jsondecode(
data.meraki_networks_appliance_warm_spare.warm_spare[network_id].item
).enabled,
false
)
])
network_id = each.key
}
data.meraki_networks_appliance_warm_spare.warm_spare["L_62*************808"]: Still reading... [3m20s elapsed]
data.meraki_networks_appliance_warm_spare.warm_spare["L_83*************708"]: Still reading... [3m20s elapsed]
data.meraki_networks_appliance_warm_spare.warm_spare["L_62*************858"]: Still reading... [3m10s elapsed]
data.meraki_networks_appliance_warm_spare.warm_spare["L_83*************021"]: Still reading... [3m20s elapsed]
data.meraki_networks_appliance_warm_spare.warm_spare["L_83*************709"]: Still reading... [3m10s elapsed]
data.meraki_networks_appliance_warm_spare.warm_spare["L_83*************720"]: Still reading... [3m20s elapsed]
data.meraki_networks_appliance_warm_spare.warm_spare["L_83*************662"]: Still reading... [3m20s elapsed]
...
...
...
╷
│ Error: Failure when executing GetNetworkApplianceWarmSpare
│
│ with data.meraki_networks_appliance_warm_spare.warm_spare["L_83*************709"],
│ on network-zones-offices.tf line 116, in data "meraki_networks_appliance_warm_spare" "warm_spare":
│ 116: data "meraki_networks_appliance_warm_spare" "warm_spare" {
│
│ error with operation GetNetworkApplianceWarmSpare
╵
However, if I use my API Key and query against:
https://api.meraki.com/api/v1/networks/L_83*************709/appliance/warmSpare
I get a valid response of:
{
"enabled": false,
"primarySerial": "OMITTED-INFO",
"spareSerial": null
}
However, this also occurs on a Network ID that does have a wamSpare enabled:
https://api.meraki.com/api/v1/networks/L_62*************823/appliance/warmSpare
{
"enabled": true,
"primarySerial": "OMITTED-SERIAL-1",
"spareSerial": "OMITTED-SERIAL-2",
"uplinkMode": "virtual",
"wan1": {
"ip": "1.2.3.53",
"subnet": "1.2.3.48/29"
},
"wan2": {
"ip": "2.0.1.22",
"subnet": ""
}
}
(Note that the IP Addresses have been changed)
Is there any known issues with the terraform provider being run on dashboards? I understand and am aware that it is in alpha/beta testing, but it has been working generally pretty well, except for these two problems.