Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Special characters in friendly name cause modification on every apply #76

Open
innovate-invent opened this issue Sep 3, 2020 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@innovate-invent
Copy link

For example:

resource "uptimerobot_monitor" "id783840372" {
  friendly_name = "Galaxy for IslandCompare (AWS)"

results in

  # uptimerobot_monitor.id783840372 will be updated in-place
  ~ resource "uptimerobot_monitor" "id783840372" {
        custom_http_headers = {}
      ~ friendly_name       = "Galaxy for IslandCompare (AWS)" -> "Galaxy for IslandCompare (AWS)"

on every apply

@drubin
Copy link
Contributor

drubin commented Sep 4, 2020

This is sadly expetect behaviour and the uptime robot Api is doing this ( which is kinda bad)

You can fix this by changing your monitor name to not use the special chars or to just encode them as the Api returns them.

This should be documented though...

@innovate-invent
Copy link
Author

Wouldn't it be appropriate for the provider to handle the necessary encoding between human readable and what the API requires?

@drubin
Copy link
Contributor

drubin commented Sep 4, 2020

I wouldn't think so because this is a not how core Terraform works it's also not documented how to unencode/encode or how to handle it.

This is how gpc and aws plugins work too when things get in

@louy
Copy link
Owner

louy commented Sep 5, 2020

This is obviously bad api behaviour, but I wonder whether calling html#UnescapeString on that field when fetching would fix this and make the UX a bit nicer. Should be easy to test and hopefully wouldn't introduce any unexpected issues.

@louy louy added enhancement New feature or request good first issue Good for newcomers labels Sep 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants