The meraki_wireless_ssid_splash_settings resource has several idempotency issues.
Reproduction
To demonstrate, put a png file named 1x1.png in your module folder, you can download one from Wikipedia.
Then add the following resource to your module and run terraform apply:
resource "meraki_wireless_ssid_splash_settings" "splash" {
network_id = meraki_network.demo_network.id
number = 0
splash_logo_image_contents = filebase64("${path.module}/1x1.png")
splash_logo_extension = "png"
splash_logo_image_format = "png"
welcome_message = "test"
}
Issue 1 - Idempotency
Run terraform apply for a second time.
Outcome:
# meraki_wireless_ssid_splash_settings.splash will be updated in-place
~ resource "meraki_wireless_ssid_splash_settings" "splash" {
id = "0"
+ splash_logo_image_contents = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII="
+ splash_logo_image_format = "png"
# (4 unchanged attributes hidden)
}
Expected outcome: Empty plan
Issue 2 - Destroy of Terraform resource leaves dangling configuration
Run terraform destroy -target=meraki_wireless_ssid_splash_settings.splash
Outcome: Review the configuration in the Meraki Dashboard, the splash page configuration is still present without any changes to it.
Expected outcome: Splash page configuration is removed
Issue 3 - Documentation for removing logo incorrect
The documentation states that splash_logo_md5 has to be set to null to remove the logo, this is incorrect.
Setting splash_logo_md5 = null does not remove the logo, instead it has to be set to empty string: splash_logo_md5 = "".
Issue 4 splash_logo_md5 should not be exposed to the user
Attempting to set splash_logo_md5 in the resource as documented (for example with splash_logo_md5 = filemd5("${path.module}/1x1.png")) leads to unexpected errors.
My observation is that the MD5 which the Dashboard API returns does not match the MD5 of the local file.
When the user attempts to set the local MD5 in the resource, the API returns the following error: splashLogo is not found in the image storage..
For the user of the provider it should not be necessary to manually set this at all.
Exposing it as part of the resource definition is unnecessary.
If splash_logo_image_contents is null then the provider should internally ensure that splash_logo_md5 = "".
The
meraki_wireless_ssid_splash_settingsresource has several idempotency issues.Reproduction
To demonstrate, put a png file named 1x1.png in your module folder, you can download one from Wikipedia.
Then add the following resource to your module and run
terraform apply:Issue 1 - Idempotency
Run
terraform applyfor a second time.Outcome:
Expected outcome: Empty plan
Issue 2 - Destroy of Terraform resource leaves dangling configuration
Run
terraform destroy -target=meraki_wireless_ssid_splash_settings.splashOutcome: Review the configuration in the Meraki Dashboard, the splash page configuration is still present without any changes to it.
Expected outcome: Splash page configuration is removed
Issue 3 - Documentation for removing logo incorrect
The documentation states that
splash_logo_md5has to be set tonullto remove the logo, this is incorrect.Setting
splash_logo_md5 = nulldoes not remove the logo, instead it has to be set to empty string:splash_logo_md5 = "".Issue 4
splash_logo_md5should not be exposed to the userAttempting to set
splash_logo_md5in the resource as documented (for example withsplash_logo_md5 = filemd5("${path.module}/1x1.png")) leads to unexpected errors.My observation is that the MD5 which the Dashboard API returns does not match the MD5 of the local file.
When the user attempts to set the local MD5 in the resource, the API returns the following error:
splashLogo is not found in the image storage..For the user of the provider it should not be necessary to manually set this at all.
Exposing it as part of the resource definition is unnecessary.
If
splash_logo_image_contentsisnullthen the provider should internally ensure thatsplash_logo_md5 = "".