thousandeyes / terraform-provider-thousandeyes

ThousandEyes Terraform Provider
Apache License 2.0
21 stars 26 forks source link

feat: allows overriding the API Endpoint #109

Closed pedro-te closed 2 years ago

pedro-te commented 2 years ago
go vet ./... && echo && go test ./...

?       github.com/thousandeyes/terraform-provider-thousandeyes [no test files]
ok      github.com/thousandeyes/terraform-provider-thousandeyes/thousandeyes    0.434s

Tested while working on the PR for the Go SDK:

Tested locally without overriding:

╷
│ Warning: Provider development overrides are in effect
│
│ The following provider development overrides are set in the CLI configuration:
│  - thousandeyes/thousandeyes in /Users/pedrorg/go/bin
│
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published releases.
╵
thousandeyes_alert_rule.test_alert_rule: Refreshing state... [id=4946549]
thousandeyes_agent_to_server.thousandeyes_agent_to_server_tcp_no_port: Refreshing state... [id=3113616]
thousandeyes_dns_server.example_dns_server_test: Refreshing state... [id=3027162]
thousandeyes_agent_to_agent.example_agent_to_agent: Refreshing state... [id=3026866]
thousandeyes_label.tf: Refreshing state... [id=410351]
thousandeyes_alert_rule.thousandeyes_alert_rule_slack: Refreshing state... [id=5009877]
thousandeyes_sip_server.sip_server_example: Refreshing state... [id=3026862]
thousandeyes_agent_to_server.thousandeyes_agent_to_server_icmp_test: Refreshing state... [id=3113617]
thousandeyes_agent_to_server.google_agent_to_server: Refreshing state... [id=3026865]
thousandeyes_alert_rule.test_alert_rule-2: Refreshing state... [id=4946550]
thousandeyes_voice.webex_rtp_example: Refreshing state... [id=3026905]
thousandeyes_page_load.test: Refreshing state... [id=3026863]
thousandeyes_http_server.www_thousandeyes_http_test: Refreshing state... [id=3026864]

No changes. Your infrastructure matches the configuration.

And with overrides (of course it fails):

╷
│ Warning: Provider development overrides are in effect
│
│ The following provider development overrides are set in the CLI configuration:
│  - thousandeyes/thousandeyes in /Users/pedrorg/go/bin
│
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published releases.
╵
thousandeyes_alert_rule.test_alert_rule: Refreshing state... [id=4946549]
thousandeyes_agent_to_server.thousandeyes_agent_to_server_tcp_no_port: Refreshing state... [id=3113616]
thousandeyes_agent_to_server.thousandeyes_agent_to_server_icmp_test: Refreshing state... [id=3113617]
thousandeyes_agent_to_server.google_agent_to_server: Refreshing state... [id=3026865]
thousandeyes_label.tf: Refreshing state... [id=410351]
thousandeyes_dns_server.example_dns_server_test: Refreshing state... [id=3027162]
thousandeyes_agent_to_agent.example_agent_to_agent: Refreshing state... [id=3026866]
thousandeyes_sip_server.sip_server_example: Refreshing state... [id=3026862]
thousandeyes_alert_rule.test_alert_rule-2: Refreshing state... [id=4946550]
thousandeyes_alert_rule.thousandeyes_alert_rule_slack: Refreshing state... [id=5009877]
╷
│ Error: Get "https://api.millioneyes.com/v9/agents.json?aid=69": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
│
│   with data.thousandeyes_agent.arg_cordoba,
│   on main.tf line 1, in data "thousandeyes_agent" "arg_cordoba":
│    1: data "thousandeyes_agent" "arg_cordoba" {
│
╵
╷
│ Error: Get "https://api.millioneyes.com/v9/agents.json?aid=69": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
│
│   with data.thousandeyes_agent.arg_bsas,
│   on main.tf line 5, in data "thousandeyes_agent" "arg_bsas":
│    5: data "thousandeyes_agent" "arg_bsas" {

Note that this is jumping intentionally from 2.1.0 to 2.3.0. 2.2.0 includes the recent updates made to support Third Party notifications on alert rules in the Go SDK. 2.3.0 includes these changes too. They are harmless as the support for Third Party notifications still needs to be implemented in the terraform provider, it only exists in the Go SDK atm.

pedro-te commented 2 years ago

Sorry @sfreitas-te , had to force push to include the new docs, forgot to generate them before. Can you re-review please?