thousandeyes / terraform-provider-thousandeyes

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

[Bug]: Unable to set use_public_bgp as true for agent_to_server tests #142

Closed kiraum closed 8 months ago

kiraum commented 11 months ago

What versions are you using?

Provider version 2.0.2 Terraform version 1.5.7

What did you expect to happen?

After configuration applied via terraform without any error/warning that the configuration/parameter that's supported by this provider to be set on ThousandEyes test.

Parameter use_public_bgp for agent_to_server tests: https://registry.terraform.io/providers/thousandeyes/thousandeyes/latest/docs/resources/agent_to_server#use_public_bgp

What actually happened?

Terraform apply is successful, but configuration is not changed/update on ThousandEyes platform.

Parameter use_public_bgp for agent_to_server tests: https://registry.terraform.io/providers/thousandeyes/thousandeyes/latest/docs/resources/agent_to_server#use_public_bgp

Terraform code to reproduce the bug

resource "thousandeyes_agent_to_server" "example_agent_to_server_test" {
  test_name      = "test
  interval       = 120
  alerts_enabled = false
  use_public_bgp = true
  protocol       = "ICMP"

  server = "www.thousandeyes.com"

  agents {
    agent_id = 3 # Singapore
  }
}

Any additional comments or code?

No response

Steps to reproduce the bug

% terraform apply -target=module.network.thousandeyes_agent_to_server.example_agent_to_server_test
module.network.thousandeyes_agent_to_server.example_agent_to_server_test: Refreshing state... [id=281474976731002]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.network.thousandeyes_agent_to_server.example_agent_to_server_test will be updated in-place
  ~ resource "thousandeyes_agent_to_server" "example_agent_to_server_test" {
        id                     = "281474976731002"
      ~ use_public_bgp         = false -> true
        # (23 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
<SANITIZED>

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

module.network.thousandeyes_agent_to_server.example_agent_to_server_test: Modifying... [id=281474976731002]
module.network.thousandeyes_agent_to_server.example_agent_to_server_test: Modifications complete after 3s [id=281474976731002]
<SANITIZED>

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

% terraform plan -target=module.network.thousandeyes_agent_to_server.example_agent_to_server_test
module.network.thousandeyes_agent_to_server.example_agent_to_server_test: Refreshing state... [id=281474976731002]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.network.thousandeyes_agent_to_server.example_agent_to_server_test will be updated in-place
  ~ resource "thousandeyes_agent_to_server" "example_agent_to_server_test" {
        id                     = "281474976731002"
      ~ use_public_bgp         = false -> true
        # (23 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
bskufcate commented 9 months ago

Hello @kiraum,

You'll need to use the bgp_measurements flag as a primary means of manipulation of the BGP layer for a test. The additional use_public_bgp flag is only used to indicate (when enabling) that all public BGP monitors should be used (the alternative would be to use the bgp_monitors to specify individual (private) BGP monitors). When disabling BGP layer on a test, use_public_bgp parameter should be set to false too, or removed altogether.

joaomper-TE commented 8 months ago

@bskufcate thanks for helping out. @kiraum can you confirm if this can be closed? Probably we should improve our docs a little bit in regards to this

kiraum commented 8 months ago

Yes, I am fine closing it, thanks!