-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Added data source for WAF policy (fixes #7468) #7469
Added data source for WAF policy (fixes #7468) #7469
Conversation
Added data source for WAF policy Added documentation Docs. picked one Added link Updates udates Docs Nailed it
To my best of knowledge this pull request is done. However @mbfrahry you made some changes to the changelog (that I saw after squashing my "trial and error" commits getting to know the code/toolset). These seem unrelevant as they are related to a different resource (azurerm_role_definition) Another question is what is needed to get this merged into master? The data source is something we actually want to use to seperate the code base for WAF policies and application gateways in Azure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @rikribbers
Thanks for this PR :)
Taking a look through this mostly LGTM - if we can remove the changelog entry (and the tests pass) then this should otherwise be good to merge 👍
Thanks!
@tombuildsstuff Thx for your respone, I have removed the changelog entry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks for this @rikribbers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @rikribbers
Apologies I just noticed there's no test for this new data source - would you mind adding one covering this? I've added an example inline - but this should otherwise be good to merge 👍
Thanks!
azurerm/internal/services/network/web_application_firewall_policy_data_source.go
Show resolved
Hide resolved
@tombuildsstuff I have added an acceptance test. Could you verify if it is correct? |
I see that there are a few pending check including the travis build, however if I follow the link the build is succesful... is there something broken or am I missing something here.... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @rikribbers
Thanks for adding a test here, apologies for the delayed re-review!
Taking a look this is mostly looking good now, if we can update the Test Configuration then the tests should pass and we should be able to get this in 👍
Thanks!
azurerm/internal/services/network/tests/web_application_firewall_policy_data_source_test.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/network/tests/web_application_firewall_policy_data_source_test.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/network/tests/web_application_firewall_policy_data_source_test.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/network/tests/web_application_firewall_policy_data_source_test.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/network/tests/web_application_firewall_policy_data_source_test.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/network/tests/web_application_firewall_policy_data_source_test.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/network/tests/web_application_firewall_policy_data_source_test.go
Outdated
Show resolved
Hide resolved
@tombuildsstuff updated the test. Should have seen these changes myself using the provider on a daily basis.... will look better next time ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @rikribbers, thanks for the changes. I'm getting some errors running the test, have added some suggestions inline :)
azurerm/internal/services/network/tests/web_application_firewall_policy_data_source_test.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/network/web_application_firewall_policy_data_source.go
Show resolved
Hide resolved
azurerm/internal/services/network/tests/web_application_firewall_policy_data_source_test.go
Show resolved
Hide resolved
Thx for the reply, will look into it. I was wondering how I can run only this test locally. so I can verify stuff is working correctly. |
You'll need to supply an Azure subscription and tests do incur usage costs. This should do it: make testacc TEST=./azurerm/internal/services/network/tests/ TESTARGS='-run TestAccDataSourceAzureRMWebApplicationFirewallPolicy_' Note I did run the test myself with my suggested changes and it passed. |
Again many thx for helping, I am just getting to know how the provider is actually working. I want to do thing right but also understand them... |
…ll_policy_data_source_test.go Co-authored-by: Tom Bamford <[email protected]>
…icy_data_source.go Co-authored-by: Tom Bamford <[email protected]>
Hello @manicminer and @tombuildsstuff as far as I can tell this is now done. I have run the acceptance test successfully locally. Many thanks to you and the provider team for helping me figure out how this works. With this (and another change) merged I have learned a lot about go, the azurerm provider and once released we have the perfect solution for managing web application firewall policies in combination with application gateways. ❤️ |
@rikribbers No problem at all, great to welcome you as a contributor :) I'm just running the acceptance tests on our CI server, but this looks good and it's passing locally for me. |
This has been released in version 2.18.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.18.0"
}
# ... other configuration ... |
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 👉 [email protected]. Thanks! |
Should fix #7468
However being a newbee go programmer I might need some help getting it up and running. I have a working execution plan with an data source but I am
in doubt ifalsmost sure now that the resource schema for reading is correct... any comments highly appreciated.