Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Connection Monitor resource and Network Watcher data source #2791

Merged
merged 6 commits into from
Feb 19, 2019
Merged

Add Connection Monitor resource and Network Watcher data source #2791

merged 6 commits into from
Feb 19, 2019

Conversation

lewinski
Copy link
Contributor

This PR adds a new resource to manage Connection Monitors, which allow network connectivity monitoring between VMs and an endpoint (another VM, IP, or FQDN) via the existing Network Watcher resources.

Because Network Watchers are limited to one per region per subscription, this PR also adds a Network Watcher data source. This may be useful when multiple Terraform configurations using Network Watchers, Connection Monitors, or Packet Captures are targeted at the same subscription.

@lewinski
Copy link
Contributor Author

lewinski commented Feb 9, 2019

I just updated this with code to support the strict import behavior that I saw implemented on a number of other resources recently.

@lewinski
Copy link
Contributor Author

lewinski commented Feb 9, 2019

Acceptance test run:

$ make testacc TESTARGS='-run=TestAccAzureRMNetworkWatcher/ConnectionMonitor'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccAzureRMNetworkWatcher/ConnectionMonitor -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
?   	github.com/terraform-providers/terraform-provider-azurerm	[no test files]
=== RUN   TestAccAzureRMNetworkWatcher
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/vmComplete
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/destinationUpdate
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/missingDestinationInvalid
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/addressBasic
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/addressUpdate
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/vmBasic
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/requiresImport
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/addressComplete
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/vmUpdate
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/bothDestinationsInvalid
--- PASS: TestAccAzureRMNetworkWatcher (5840.29s)
    --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor (5840.29s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/vmComplete (530.20s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/destinationUpdate (924.33s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/missingDestinationInvalid (519.28s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/addressBasic (557.94s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/addressUpdate (921.53s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/vmBasic (572.15s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/requiresImport (629.02s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/addressComplete (526.00s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/vmUpdate (659.81s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/bothDestinationsInvalid (0.03s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	5840.328s
testing: warning: no tests to run
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure	0.029s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/kubernetes	0.007s [no tests to run]
?   	github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response	[no test files]
?   	github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/set	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/suppress	0.027s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf	0.018s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate	0.024s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils	0.030s [no tests to run]
?   	github.com/terraform-providers/terraform-provider-azurerm/version	[no test files]

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lewinski,

Thank you for this PR! I have given it a lookover and left some mostly minor comments inline. Once those are fixed up this should be good to merge 🙂

azurerm/data_source_network_watcher.go Show resolved Hide resolved
azurerm/resource_arm_connection_monitor.go Show resolved Hide resolved
azurerm/resource_arm_connection_monitor.go Show resolved Hide resolved
azurerm/resource_arm_connection_monitor.go Outdated Show resolved Hide resolved
azurerm/resource_arm_connection_monitor.go Outdated Show resolved Hide resolved
azurerm/resource_arm_connection_monitor.go Outdated Show resolved Hide resolved
@lewinski
Copy link
Contributor Author

Thanks for the review, @katbyte. I believe I have incorporated all of your feedback into the PR.

@ghost ghost removed the waiting-response label Feb 12, 2019
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @lewinski, LGTM now! will merge once tests pass

@katbyte katbyte modified the milestones: 1.24.0, 1.23.0 Feb 14, 2019
@katbyte
Copy link
Collaborator

katbyte commented Feb 19, 2019

Tests pass:

[22:55:21] kt@snowbook:~/hashi/..3../terraform-providers/terraform-provider-azurerm▸network-watcher-connection-monitor$ testazure TestAccAzureRMNetworkWatcher/ConnectionMonitor
==> Fixing source code with gofmt...
# This logic should match the search logic in scripts/gofmtcheck.sh
gofmt -s -w `find . -name '*.go' | grep -v vendor`
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./azurerm -v -test.run=TestAccAzureRMNetworkWatcher/ConnectionMonitor -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccAzureRMNetworkWatcher
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/addressComplete
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/vmBasic
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/bothDestinationsInvalid
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/addressBasic
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/vmComplete
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/vmUpdate
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/destinationUpdate
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/missingDestinationInvalid
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/requiresImport
=== RUN   TestAccAzureRMNetworkWatcher/ConnectionMonitor/addressUpdate
--- PASS: TestAccAzureRMNetworkWatcher (6012.62s)
    --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor (6012.62s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/addressComplete (538.57s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/vmBasic (598.72s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/bothDestinationsInvalid (0.04s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/addressBasic (756.07s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/vmComplete (557.04s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/vmUpdate (731.42s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/destinationUpdate (956.60s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/missingDestinationInvalid (519.27s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/requiresImport (582.80s)
        --- PASS: TestAccAzureRMNetworkWatcher/ConnectionMonitor/addressUpdate (772.10s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	6012.663s
[00:35:44] kt@snowbook:~/hashi/..3../terraform-providers/terraform-provider-azurerm▸master-fallback$

@katbyte katbyte merged commit 412001c into hashicorp:master Feb 19, 2019
katbyte added a commit that referenced this pull request Feb 19, 2019
katbyte pushed a commit that referenced this pull request Mar 5, 2019
I noticed the changelog entries for #2791 looked wrong so this corrects them.
@ghost
Copy link

ghost commented Mar 8, 2019

This has been released in version 1.23.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
	version = "~> 1.23.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Mar 21, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants