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

Refactor azurerm_network_watcher_flow_log and add supports for location and tags #11670

Merged
merged 7 commits into from
Jun 4, 2021

Conversation

magodo
Copy link
Collaborator

@magodo magodo commented May 12, 2021

This refactors the azurerm_network_watcher_flow_log to using its own separate endpoint - rather than using the configureFlowLog endpoint of the Network Watcher (more details here)

This PR is implemented in a way to avoid breaking changes on the existing instances and ensure backward compatiblility (locally tested).

Besides, I've modified the test cases to make them sequential - the prior implementation actually are still running in parallel at the end.

Fixes: #11587

Test Result

💤 TF_ACC=1 go test -v -timeout=8h ./azurerm/internal/services/network -run="TestAccNetworkWatcherFlowLog_"
2021/05/12 14:25:23 [DEBUG] not using binary driver name, it's no longer needed
2021/05/12 14:25:23 [DEBUG] not using binary driver name, it's no longer needed
=== RUN   TestAccNetworkWatcherFlowLog_basic
--- PASS: TestAccNetworkWatcherFlowLog_basic (228.54s)
=== RUN   TestAccNetworkWatcherFlowLog_disabled
--- PASS: TestAccNetworkWatcherFlowLog_disabled (228.47s)
=== RUN   TestAccNetworkWatcherFlowLog_reenabled
--- PASS: TestAccNetworkWatcherFlowLog_reenabled (298.10s)
=== RUN   TestAccNetworkWatcherFlowLog_retentionPolicy
--- PASS: TestAccNetworkWatcherFlowLog_retentionPolicy (323.25s)
=== RUN   TestAccNetworkWatcherFlowLog_updateStorageAccount
--- PASS: TestAccNetworkWatcherFlowLog_updateStorageAccount (359.24s)
=== RUN   TestAccNetworkWatcherFlowLog_trafficAnalytics
--- PASS: TestAccNetworkWatcherFlowLog_trafficAnalytics (566.27s)
=== RUN   TestAccNetworkWatcherFlowLog_version
--- PASS: TestAccNetworkWatcherFlowLog_version (371.40s)
=== RUN   TestAccNetworkWatcherFlowLog_location
--- PASS: TestAccNetworkWatcherFlowLog_location (234.28s)
=== RUN   TestAccNetworkWatcherFlowLog_tags
--- PASS: TestAccNetworkWatcherFlowLog_tags (317.00s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network     2926.746s

@magodo
Copy link
Collaborator Author

magodo commented May 26, 2021

@katbyte Would you please take a look at this PR? Some customers are blocked by this.

data := acceptance.BuildTestData(t, "azurerm_network_watcher", "test")
r := NetworkWatcherResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
data.ResourceSequentialTest(t, r, []acceptance.TestStep{
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this working correctly? all the tests are failing in teamcity now, worse then before

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 @magodo - LGTM 👍

@katbyte katbyte added this to the v2.62.0 milestone Jun 3, 2021
katbyte added a commit that referenced this pull request Jun 3, 2021
@katbyte katbyte modified the milestones: v2.62.0, v2.63.0 Jun 4, 2021
@katbyte katbyte merged commit a3e73e9 into hashicorp:master Jun 4, 2021
katbyte added a commit that referenced this pull request Jun 4, 2021
@ghost
Copy link

ghost commented Jun 11, 2021

This has been released in version 2.63.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 = "~> 2.63.0"
}
# ... other configuration ...

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 12, 2021
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.

Support for adding tags in azurerm_network_watcher_flow_log resource
2 participants