forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add standard type vmwareengine network (GoogleCloudPlatform#9416)
- Loading branch information
1 parent
eeb51c9
commit 230b9e4
Showing
10 changed files
with
68 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,4 @@ resource "time_sleep" "wait_60_seconds" { | |
depends_on = [google_project.acceptance] | ||
|
||
create_duration = "60s" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
mmv1/templates/terraform/examples/vmware_engine_network_standard.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
resource "google_vmwareengine_network" "<%= ctx[:primary_resource_id] %>" { | ||
name = "standard-nw" | ||
location = "global" # Standard network needs to be global | ||
type = "STANDARD" | ||
description = "VMwareEngine standard network sample" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...ird_party/terraform/services/vmwareengine/data_source_google_vmwareengine_network_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package vmwareengine_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" | ||
"github.com/hashicorp/terraform-provider-google/google/acctest" | ||
) | ||
|
||
func TestAccDataSourceVmwareEngineNetwork_basic(t *testing.T) { | ||
t.Parallel() | ||
|
||
context := map[string]interface{}{ | ||
"random_suffix": acctest.RandString(t, 10), | ||
} | ||
|
||
acctest.VcrTest(t, resource.TestCase{ | ||
PreCheck: func() { acctest.AccTestPreCheck(t) }, | ||
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), | ||
CheckDestroy: testAccCheckVmwareengineNetworkDestroyProducer(t), | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccDataSourceVmwareEngineNetworkConfig(context), | ||
Check: resource.ComposeTestCheckFunc( | ||
acctest.CheckDataSourceStateMatchesResourceStateWithIgnores("data.google_vmwareengine_network.ds", "google_vmwareengine_network.nw", map[string]struct{}{}), | ||
), | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func testAccDataSourceVmwareEngineNetworkConfig(context map[string]interface{}) string { | ||
return acctest.Nprintf(` | ||
resource "google_vmwareengine_network" "nw" { | ||
name = "tf-test-sample-network%{random_suffix}" | ||
location = "global" # Standard network needs to be global | ||
type = "STANDARD" | ||
description = "VMwareEngine standard network sample" | ||
} | ||
data "google_vmwareengine_network" "ds" { | ||
name = google_vmwareengine_network.nw.name | ||
location = "global" | ||
depends_on = [ | ||
google_vmwareengine_network.nw, | ||
] | ||
} | ||
`, context) | ||
} |
87 changes: 0 additions & 87 deletions
87
...party/terraform/services/vmwareengine/data_source_google_vmwareengine_network_test.go.erb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters