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

Added data source for WAF policy (fixes #7468) #7469

Merged
merged 12 commits into from
Jul 7, 2020
Merged

Added data source for WAF policy (fixes #7468) #7469

merged 12 commits into from
Jul 7, 2020

Conversation

rikribbers
Copy link
Contributor

@rikribbers rikribbers commented Jun 24, 2020

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 if alsmost sure now that the resource schema for reading is correct... any comments highly appreciated.

mbfrahry and others added 2 commits June 25, 2020 08:25
Added data source for WAF policy

Added documentation

Docs. picked one

Added link

Updates

udates

Docs

Nailed it
@rikribbers
Copy link
Contributor Author

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.

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a 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!

CHANGELOG.md Outdated Show resolved Hide resolved
@rikribbers
Copy link
Contributor Author

@tombuildsstuff Thx for your respone, I have removed the changelog entry.

@ghost ghost removed the waiting-response label Jun 25, 2020
Copy link
Contributor

@tombuildsstuff tombuildsstuff left a 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

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a 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!

@ghost ghost added size/L and removed size/M labels Jun 25, 2020
@rikribbers
Copy link
Contributor Author

@tombuildsstuff I have added an acceptance test. Could you verify if it is correct?

@ghost ghost removed the waiting-response label Jun 26, 2020
@rikribbers
Copy link
Contributor Author

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....

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a 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!

@rikribbers
Copy link
Contributor Author

@tombuildsstuff updated the test. Should have seen these changes myself using the provider on a daily basis.... will look better next time ;-)

@ghost ghost removed the waiting-response label Jul 1, 2020
@katbyte katbyte modified the milestones: v2.17.0, v2.18.0 Jul 3, 2020
@rikribbers rikribbers requested a review from tombuildsstuff July 3, 2020 14:35
Copy link
Contributor

@manicminer manicminer left a 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 :)

@rikribbers
Copy link
Contributor Author

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.

@manicminer
Copy link
Contributor

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.

@rikribbers
Copy link
Contributor Author

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...

@rikribbers
Copy link
Contributor Author

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. ❤️

@manicminer
Copy link
Contributor

@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.

@manicminer
Copy link
Contributor

manicminer commented Jul 7, 2020

Test results (new data source and existing resource):

Screenshot 2020-07-07 22 36 23
Screenshot 2020-07-07 22 36 35

@manicminer manicminer merged commit ab38603 into hashicorp:master Jul 7, 2020
manicminer added a commit that referenced this pull request Jul 7, 2020
@ghost
Copy link

ghost commented Jul 10, 2020

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 ...

@ghost
Copy link

ghost commented Aug 7, 2020

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!

@ghost ghost locked and limited conversation to collaborators Aug 7, 2020
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 WAF policy data source
5 participants