-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 "disabled" support to firewall endpoint association resource #10246
Added "disabled" support to firewall endpoint association resource #10246
Conversation
- Fixed create_url sending incorrect parameter (firewallEndpointId ~> firewallEndpointAssociationId); Tests: - Added new test for "disabled" field; - Added "billingProjectId" field to the "google_network_security_firewall_endpoint" resource"; - Changed "parent" attribute in "google_network_security_firewall_endpoint_association"; - Added "disabled" argument to update function; - Cleaned Sprintf formatting;
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @rileykarson, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
@@ -22,26 +23,86 @@ func TestAccNetworkSecurityFirewallEndpointAssociations_basic(t *testing.T) { | |||
|
|||
orgId := envvar.GetTestOrgFromEnv(t) | |||
randomSuffix := acctest.RandString(t, 10) | |||
billingProjectId := envvar.GetTestProjectFromEnv() |
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.
nit: spacing (spaces -> tabs)
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccNetworkSecurityFirewallEndpointAssociation_basic(randomSuffix, orgId, billingProjectId, projectNumberId), | ||
Check: resource.ComposeTestCheckFunc( |
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.
nit: spacing (spaces -> tabs)
return fmt.Sprintf(` | ||
resource "google_compute_network" "foobar" { | ||
provider = google-beta | ||
name = "tf-test-my-vpc%s" | ||
provider = google-beta |
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.
nit: spacing (tabs -> spaces)
provider = google-beta | ||
name = "tf-test-my-vpc%s" | ||
provider = google-beta | ||
name = "tf-test-my-vpc%[2]s" |
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.
Can you switch to context
/ Nprintf
instead of Sprintf? This will be much easier to read using that formatting instead.
...services/networksecurity/resource_network_security_firewall_endpoint_association_test.go.erb
Outdated
Show resolved
Hide resolved
- Code spacing;
- Removed explicit dependency now unnecessary due to these changes;
@@ -20,28 +21,91 @@ func TestAccNetworkSecurityFirewallEndpointAssociations_basic(t *testing.T) { | |||
acctest.SkipIfVcr(t) |
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.
This can be removed I believe. I looked into this resource in #10308 and though I didn't get the test to successfully pass I believe VCR should work for this test.
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.
@matheusaleixo-cit let's apply this change- it'll make our presubmits run the test.
Added to the PR description that this also fixes hashicorp/terraform-provider-google#17699 |
/gcbrun |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: Click here to see the affected service packages
Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccNetworkSecurityFirewallEndpointAssociations_basic|TestAccNetworkSecurityFirewallEndpointAssociations_disabled |
|
Hello @rileykarson @slevenick! Are there any other pending issues preventing the merge of this PR? |
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! No further action needed.
Adds support for optional 'disabled' field to 'google_network_security_firewall_endpoint_association'
Fixes: hashicorp/terraform-provider-google#17610
Fixes: hashicorp/terraform-provider-google#17699
Also fixes to the test 'testAccNetworkSecurityFirewallEndpointAssociation_basic' that started failing due to recent changes to the API, such as the addition of the 'billingProjectId' field to the Firewall Endpoint. (Similar to hashicorp/terraform-provider-google#17396)
Release Note Template for Downstream PRs (will be copied)