Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions mmv1/products/compute/Router.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ samples:
ignore_read_extra:
- 'advertisedIpRanges'
- name: 'router_ncc_gw'
min_version: beta
primary_resource_id: 'foobar'
steps:
- name: 'router_ncc_gw'
min_version: beta
resource_id_vars:
router_name: 'my-router'
network_name: 'net-spoke'
Expand Down Expand Up @@ -259,7 +257,6 @@ properties:
type: ResourceRef
description: |
A URI of an NCC Gateway spoke
min_version: 'beta'
immutable: true
resource: 'Spoke'
custom_expand: 'templates/terraform/custom_expand/self_link_from_name_network_connectivity.tmpl'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ description: |
references:
guides:
QUICKSTART_TITLE: https://docs.cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/ncc-gateway-overview
api: https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1beta/projects.locations.spokes.gatewayAdvertisedRoutes
api: https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.spokes.gatewayAdvertisedRoutes
base_url: projects/{{project}}/locations/{{location}}/spokes/{{spoke}}/gatewayAdvertisedRoutes
min_version: beta
self_link: projects/{{project}}/locations/{{location}}/spokes/{{spoke}}/gatewayAdvertisedRoutes/{{name}}
create_url: projects/{{project}}/locations/{{location}}/spokes/{{spoke}}/gatewayAdvertisedRoutes?gatewayAdvertisedRouteId={{name}}
update_mask: true
Expand All @@ -37,11 +36,9 @@ async:
autogen_async: true
samples:
- name: network_connectivity_gateway_advertised_route_basic
min_version: beta
primary_resource_id: default
steps:
- name: network_connectivity_gateway_advertised_route_basic
min_version: beta
resource_id_vars:
resource_name: gateway-advertised-route-name
spoke_name: spoke-name
Expand Down
4 changes: 0 additions & 4 deletions mmv1/products/networkconnectivity/Spoke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,8 @@ samples:
hub_name: '"hub1" + randomSuffix'
- name: network_connectivity_spoke_gateway
primary_resource_id: primary
min_version: beta
steps:
- name: network_connectivity_spoke_gateway
min_version: beta
resource_id_vars:
network_name: net-spoke
hub_name: hub
Expand Down Expand Up @@ -433,7 +431,6 @@ properties:
type: NestedObject
description: This is a gateway that can apply specialized processing to traffic going through it.
immutable: true
min_version: beta
conflicts:
- linked_interconnect_attachments
- linked_router_appliance_instances
Expand Down Expand Up @@ -465,7 +462,6 @@ properties:
- name: routers
type: Array
description: Set of Cloud Routers that are attached to this NCC-GW
min_version: beta
item_type:
type: String
description: Cloud Router that is attached to the NCC-GW
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
resource "google_compute_network" "network" {
provider = google-beta
name = "{{index $.ResourceIdVars "network_name"}}"
auto_create_subnetworks = false
}

resource "google_compute_subnetwork" "subnetwork" {
provider = google-beta
name = "tf-test-subnet%{random_suffix}"
ip_cidr_range = "10.0.0.0/28"
region = "us-central1"
network = google_compute_network.network.self_link
}

resource "google_network_connectivity_hub" "basic_hub" {
provider = google-beta
name = "{{index $.ResourceIdVars "hub_name"}}"
description = "A sample hub"
labels = {
Expand All @@ -23,7 +20,6 @@ resource "google_network_connectivity_hub" "basic_hub" {
}

resource "google_network_connectivity_spoke" "primary" {
provider = google-beta
name = "{{index $.ResourceIdVars "ncc_gw_name"}}"
location = "us-central1"
description = "A sample spoke of type Gateway"
Expand All @@ -42,7 +38,6 @@ resource "google_network_connectivity_spoke" "primary" {


resource "google_compute_router" "foobar" {
provider = google-beta
name = "{{index $.ResourceIdVars "router_name"}}"
bgp {
asn = 64514
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
resource "google_compute_network" "network" {
provider = google-beta
name = "{{index $.ResourceIdVars "network_name"}}"
auto_create_subnetworks = false
}

resource "google_compute_subnetwork" "subnetwork" {
provider = google-beta
name = "tf-test-subnet%{random_suffix}"
ip_cidr_range = "10.0.0.0/28"
region = "us-central1"
network = google_compute_network.network.self_link
}

resource "google_network_connectivity_hub" "basic_hub" {
provider = google-beta
name = "{{index $.ResourceIdVars "hub_name"}}"
description = "A sample hub"
labels = {
Expand All @@ -23,7 +20,6 @@ resource "google_network_connectivity_hub" "basic_hub" {
}

resource "google_network_connectivity_spoke" "primary" {
provider = google-beta
name = "{{index $.ResourceIdVars "spoke_name"}}"
location = "us-central1"
description = "A sample spoke of type Gateway"
Expand All @@ -41,7 +37,6 @@ resource "google_network_connectivity_spoke" "primary" {
}

resource "google_network_connectivity_gateway_advertised_route" "{{$.PrimaryResourceId}}" {
provider = google-beta
spoke = google_network_connectivity_spoke.primary.name
location = "us-central1"
name = "{{index $.ResourceIdVars "resource_name"}}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
resource "google_compute_network" "network" {
provider = google-beta
name = "{{index $.ResourceIdVars "network_name"}}"
auto_create_subnetworks = false
}

resource "google_compute_subnetwork" "subnetwork" {
provider = google-beta
name = "tf-test-subnet%{random_suffix}"
ip_cidr_range = "10.0.0.0/28"
region = "us-central1"
network = google_compute_network.network.self_link
}

resource "google_network_connectivity_hub" "basic_hub" {
provider = google-beta
name = "{{index $.ResourceIdVars "hub_name"}}"
description = "A sample hub"
labels = {
Expand All @@ -23,7 +20,6 @@ resource "google_network_connectivity_hub" "basic_hub" {
}

resource "google_network_connectivity_spoke" "primary" {
provider = google-beta
name = "{{index $.ResourceIdVars "spoke_name"}}"
location = "us-central1"
description = "A sample spoke of type Gateway"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{{ if ne $.TargetVersionName `ga` -}}
package networkconnectivity_test

import (
"testing"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/hashicorp/terraform-plugin-testing/plancheck"
"github.com/hashicorp/terraform-provider-google/google/acctest"
"github.com/hashicorp/terraform-provider-google/google/envvar"
_ "github.com/hashicorp/terraform-provider-google/google/services/compute"
_ "github.com/hashicorp/terraform-provider-google/google/services/networkconnectivity"
"github.com/hashicorp/terraform-provider-google/google/envvar"
"github.com/hashicorp/terraform-plugin-testing/plancheck"
)

func TestAccNetworkConnectivityGatewayAdvertisedRouter_test_basic(t *testing.T) {
Expand All @@ -36,12 +35,12 @@ func TestAccNetworkConnectivityGatewayAdvertisedRouter_test_basic(t *testing.T)
ImportStateVerifyIgnore: []string{"labels", "terraform_labels"},
},
{
Config: testAccNetworkConnectivitySpoke_test_update(context),
ConfigPlanChecks: resource.ConfigPlanChecks{
PreApply: []plancheck.PlanCheck{
plancheck.ExpectResourceAction("google_network_connectivity_gateway_advertised_route.gateway-advertised-route", plancheck.ResourceActionUpdate),
},
},
Config: testAccNetworkConnectivitySpoke_test_update(context),
ConfigPlanChecks: resource.ConfigPlanChecks{
PreApply: []plancheck.PlanCheck{
plancheck.ExpectResourceAction("google_network_connectivity_gateway_advertised_route.gateway-advertised-route", plancheck.ResourceActionUpdate),
},
},
},
{
ResourceName: "google_network_connectivity_gateway_advertised_route.gateway-advertised-route",
Expand Down Expand Up @@ -164,6 +163,3 @@ resource "google_network_connectivity_gateway_advertised_route" "gateway-adverti
}
`, context)
}


{{- end }}
Loading