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

Error with adding email contact #15

Closed
nlamirault opened this issue Feb 6, 2019 · 9 comments
Closed

Error with adding email contact #15

nlamirault opened this issue Feb 6, 2019 · 9 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@nlamirault
Copy link
Contributor

nlamirault commented Feb 6, 2019

I try to add my email as a contact using the provider (It works with the UI). I've got this error :

Error: Error applying plan:
1 error(s) occurred:
* uptimerobot_alert_contact.nicolas_lamirault_email: 1 error(s) occurred:
* uptimerobot_alert_contact.nicolas_lamirault_email: Got error from UptimeRobot: {"message":"You can not add your e-mail as alert contact.","parameter_name":"value","passed_value":"[email protected]","type":"invalid_parameter"}

Any idea ?

@aequitas
Copy link
Contributor

I got the same problem. And also a similar problem with the monitor resource type ping:

* uptimerobot_monitor.ping: Got error from UptimeRobot: {"parameter_name":"url","passed_value":"basisbeveiliging.nl","type":"invalid_parameter"}

@aequitas
Copy link
Contributor

My bad, the ping resource was my not specifying the right type for the monitor (http instead of ping).

@aequitas
Copy link
Contributor

aequitas commented Feb 18, 2019

The account email address is added by default as a contact. So my assumption is the API disallows to add duplicate. I don't think this is an issue with this plugin.

edit: what would be helpful is a data source for alert contacts so the default alert contact data source can be obtained (using the email adres in the account data source).

@louy
Copy link
Owner

louy commented Feb 21, 2019

Good shout @aequitas. I'll see if I get a chance to implement that but feel free to contribute

@louy louy added enhancement New feature or request help wanted Extra attention is needed labels Mar 15, 2019
@leeif
Copy link
Contributor

leeif commented Mar 30, 2019

I have the same problem when I want to use the default account email as an alert contact.
Here is a solution I consider:

  • Writing an alert contact resource of default account email

  • Importing it into terraform state file

terraform import <resource> <id>

However the id of the default account email seems like 0xxxx, there is a need to change the type of id to string in the alert contact resource.
https://github.com/louy/terraform-provider-uptimerobot/blob/master/uptimerobot/api/monitor.go#L122

@aequitas
Copy link
Contributor

I got some work on this already not finished yet though. I'll try to wrap it up and get a pr out beginning of next week.

@louy
Copy link
Owner

louy commented Mar 30, 2019

I think adding a data source for alert contacts would be a nice and clean approach to solving this, but I need to verify that it’s doable using the api

I’ve not seen the 0xxxx ids but I don’t see a reason why ids shouldn’t be changed to strings (Ints are probably bad anyway) so feel free to send a PR

@aequitas
Copy link
Contributor

#21

@louy
Copy link
Owner

louy commented May 23, 2019

Fixed in #21

@louy louy closed this as completed May 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants