add autoNetworkTier to Router NAT
Fixes: https://github.com/hashicorp/terraform-provider-google/issues/16139
It adds support to set the network tier to use when automatically reserving NAT IP Addresses
If this PR is for Terraform, I acknowledge that I have:
- [x] Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
- [x] Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
- [x] Generated Terraform providers, and ran
make testandmake lintin the generated providers to ensure it passes unit and linter tests. - [x] Ran relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
- [x] Read Write release notes before writing my release note below.
Release Note Template for Downstream PRs (will be copied)
compute: added `auto_network_tier` field to `google_compute_router_nat` resource
Hello! I am a robot. It looks like you are a: Community Contributor ~Googler~ ~Core Contributor~. Tests will require approval to run.
@trodge, 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.
Hi there, I'm the Modular magician. I've detected the following information about your changes:
Diff report
Your PR generated some diffs in downstreams - here they are.
Terraform GA: Diff ( 2 files changed, 38 insertions(+)) Terraform Beta: Diff ( 2 files changed, 38 insertions(+))
Missing test report
Your PR includes resource fields which are not covered by any test.
Resource: google_compute_router_nat (11 total tests)
Please add an acceptance test which includes these fields. The test should include the following:
resource "google_compute_router_nat" "primary" {
auto_network_tier = # value needed
}
Tests analytics
Total tests: 3184
Passed tests 2855
Skipped tests: 325
Affected tests: 4
Action taken
Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccComputeRouterNat_update|TestAccComputeRouterNat_basic|TestAccComputeRouterNat_removeLogConfig|TestAccDataSourceGoogleComputeRouterNat_basic
$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccComputeRouterNat_update[Error message] [Debug log]
TestAccComputeRouterNat_basic[Error message] [Debug log]
TestAccComputeRouterNat_removeLogConfig[Error message] [Debug log]
TestAccDataSourceGoogleComputeRouterNat_basic[Error message] [Debug log]
$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test
Hello @trodge, I have been studying the first case and I think is somewhat doable. However, could you explain about the latter case, please?
Hi there, I'm the Modular magician. I've detected the following information about your changes:
Diff report
Your PR generated some diffs in downstreams - here they are.
Terraform GA: Diff ( 2 files changed, 38 insertions(+)) Terraform Beta: Diff ( 2 files changed, 38 insertions(+))
Missing test report
Your PR includes resource fields which are not covered by any test.
Resource: google_compute_router_nat (11 total tests)
Please add an acceptance test which includes these fields. The test should include the following:
resource "google_compute_router_nat" "primary" {
auto_network_tier = # value needed
}
Tests analytics
Total tests: 3235
Passed tests 2901
Skipped tests: 330
Affected tests: 4
Action taken
Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccComputeRouterNat_update|TestAccComputeRouterNat_removeLogConfig|TestAccComputeRouterNat_basic|TestAccDataSourceGoogleComputeRouterNat_basic
$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccComputeRouterNat_update[Error message] [Debug log]
TestAccComputeRouterNat_removeLogConfig[Error message] [Debug log]
TestAccComputeRouterNat_basic[Error message] [Debug log]
TestAccDataSourceGoogleComputeRouterNat_basic[Error message] [Debug log]
$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test
Hello @trodge, I have been studying the first case and I think is somewhat doable. However, could you explain about the latter case, please?
Setting default_from_api will make the field Optional and Computed in the provider, which means that any value returned from the API will be treated as though it matches an empty value in the user's config.
Helllo @trodge I tried to implement your encoder fix so it will take the project default when empty. Could you take a look, please?
Hi there, I'm the Modular magician. I've detected the following information about your changes:
Diff report
Your PR generated some diffs in downstreams - here they are.
Terraform GA: Diff ( 2 files changed, 69 insertions(+)) Terraform Beta: Diff ( 3 files changed, 112 insertions(+), 5 deletions(-))
Missing test report
Your PR includes resource fields which are not covered by any test.
Resource: google_compute_router_nat (17 total tests)
Please add an acceptance test which includes these fields. The test should include the following:
resource "google_compute_router_nat" "primary" {
auto_network_tier = # value needed
}
Tests analytics
Total tests: 887
Passed tests 802
Skipped tests: 72
Affected tests: 13
Click here to see the affected service packages
- compute
Action taken
Found 13 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccComputeRouterNat_withPrivateNat|TestAccComputeRouterNat_AutoNetworkTier|TestAccComputeRouterNat_withManualIpAndSubnetConfiguration|TestAccComputeRouterNat_withNatRules|TestAccComputeRouterNat_withPortAllocationMethods|TestAccComputeRouterNat_withNatIpsAndDrainNatIps|TestAccDataSourceGoogleComputeRouterNat_basic|TestAccComputeRouterNat_withPrivateNatAndEmptyActionActiveRanges|TestAccComputeRouterNat_update|TestAccComputeRouterNat_removeLogConfig|TestAccComputeRouterNat_withPrivateNatAndEmptyAction|TestAccComputeRouterNat_basic|TestAccComputeRouterNat_withPrivateNatAndRules
$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeRouterNat_withPrivateNat[Debug log]
TestAccComputeRouterNat_withManualIpAndSubnetConfiguration[Debug log]
TestAccComputeRouterNat_withNatRules[Debug log]
TestAccComputeRouterNat_withPortAllocationMethods[Debug log]
TestAccComputeRouterNat_withNatIpsAndDrainNatIps[Debug log]
TestAccComputeRouterNat_withPrivateNatAndRules[Debug log]
Rerun these tests in REPLAYING mode to catch issues
$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$
$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccComputeRouterNat_AutoNetworkTier[Error message] [Debug log]
TestAccDataSourceGoogleComputeRouterNat_basic[Error message] [Debug log]
TestAccComputeRouterNat_withPrivateNatAndEmptyActionActiveRanges[Error message] [Debug log]
TestAccComputeRouterNat_update[Error message] [Debug log]
TestAccComputeRouterNat_removeLogConfig[Error message] [Debug log]
TestAccComputeRouterNat_withPrivateNatAndEmptyAction[Error message] [Debug log]
TestAccComputeRouterNat_basic[Error message] [Debug log]
$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test
@maxi-cit is this PR still active?
Hello @melinath, sorry for the late reply. it is active but other products got higher prio. However I will comeback to this one later in the week.
Hello @trodge I updated this PR making this new field default_from_api. I tried the encoder fix but it does not seems that this field should be tied to the project level default changes. I believe that we can have this field 'immutable' so it gets recreated anytime the API returns a different network tier value. do you think I should add a special note for this field?
Hi there, I'm the Modular magician. I've detected the following information about your changes:
Diff report
Your PR generated some diffs in downstreams - here they are.
google provider: Diff ( 3 files changed, 80 insertions(+))
google-beta provider: Diff ( 3 files changed, 85 insertions(+), 5 deletions(-))
Missing test report
Your PR includes resource fields which are not covered by any test.
Resource: google_compute_router_nat (21 total tests)
Please add an acceptance test which includes these fields. The test should include the following:
resource "google_compute_router_nat" "primary" {
auto_network_tier = # value needed
}
Tests analytics
Total tests: 900
Passed tests: 820
Skipped tests: 72
Affected tests: 8
Click here to see the affected service packages
- compute
Action taken
Found 8 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccComputeRegionPerInstanceConfig_removeInstanceOnDestroy|TestAccComputeRouterNat_AutoNetworkTier|TestAccComputeRouterNat_withManualIpAndSubnetConfiguration|TestAccComputeRouterNat_withNatIpsAndDrainNatIps|TestAccComputeRouterNat_withNatRules|TestAccComputeRouterNat_withPortAllocationMethods|TestAccComputeRouterNat_withPrivateNat|TestAccComputeRouterNat_withPrivateNatAndRules
$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeRegionPerInstanceConfig_removeInstanceOnDestroy[Debug log]
TestAccComputeRouterNat_AutoNetworkTier[Debug log]
TestAccComputeRouterNat_withManualIpAndSubnetConfiguration[Debug log]
TestAccComputeRouterNat_withNatIpsAndDrainNatIps[Debug log]
TestAccComputeRouterNat_withNatRules[Debug log]
TestAccComputeRouterNat_withPortAllocationMethods[Debug log]
TestAccComputeRouterNat_withPrivateNat[Debug log]
TestAccComputeRouterNat_withPrivateNatAndRules[Debug log]
$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$
$\textcolor{green}{\textsf{All tests passed!}}$ View the build log or the debug log for each test
/gcbrun
Hi there, I'm the Modular magician. I've detected the following information about your changes:
Diff report
Your PR generated some diffs in downstreams - here they are.
google provider: Diff ( 3 files changed, 80 insertions(+))
google-beta provider: Diff ( 3 files changed, 85 insertions(+), 5 deletions(-))
Missing test report
Your PR includes resource fields which are not covered by any test.
Resource: google_compute_router_nat (21 total tests)
Please add an acceptance test which includes these fields. The test should include the following:
resource "google_compute_router_nat" "primary" {
auto_network_tier = # value needed
}
Tests analytics
Total tests: 907
Passed tests: 834
Skipped tests: 72
Affected tests: 1
Click here to see the affected service packages
- compute
Action taken
Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccComputeRegionPerInstanceConfig_removeInstanceOnDestroy
$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeRegionPerInstanceConfig_removeInstanceOnDestroy[Debug log]
$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$
$\textcolor{green}{\textsf{All tests passed!}}$ View the build log or the debug log for each test
Hello @trodge thanks for the feedback. I applied your suggestions and moved the function. This should be fixing it, but if fails on the ga-provider I will make a separate one
Hi there, I'm the Modular magician. I've detected the following information about your changes:
Diff report
Your PR generated some diffs in downstreams - here they are.
google provider: Diff ( 3 files changed, 148 insertions(+))
google-beta provider: Diff ( 3 files changed, 122 insertions(+), 42 deletions(-))
Missing test report
Your PR includes resource fields which are not covered by any test.
Resource: google_compute_router_nat (21 total tests)
Please add an acceptance test which includes these fields. The test should include the following:
resource "google_compute_router_nat" "primary" {
auto_network_tier = # value needed
}
Tests analytics
Total tests: 914
Passed tests: 842
Skipped tests: 72
Affected tests: 0
Click here to see the affected service packages
- compute
$\textcolor{green}{\textsf{All tests passed!}}$ View the build log