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

Ncc ipv6 #12591

Closed
Closed

Ncc ipv6 #12591

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
48 changes: 47 additions & 1 deletion mmv1/products/networkconnectivity/Spoke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ examples:
router_name: 'external-vpn-gateway'
interconnect_attachment_name: 'partner-interconnect1'
interconnect_attachment_spoke_name: 'interconnect-attachment-spoke'
- name: 'network_connectivity_spoke_linked_producer_vpc_network_basic'
primary_resource_id: 'primary'
vars:
network_name: "net-spoke"
global_name: 'test-address'
hub_name: "hub-basic"
spoke_name: "vpc-spoke"
producer_spoke_name: "producer-spoke"
parameters:
- name: 'location'
type: String
Expand Down Expand Up @@ -128,6 +136,7 @@ properties:
- linked_interconnect_attachments
- linked_router_appliance_instances
- linked_vpc_network
- linked_producer_vpc_network
properties:
- name: 'uris'
type: Array
Expand Down Expand Up @@ -156,6 +165,7 @@ properties:
- linked_vpn_tunnels
- linked_router_appliance_instances
- linked_vpc_network
- linked_producer_vpc_network
properties:
- name: 'uris'
type: Array
Expand Down Expand Up @@ -184,6 +194,7 @@ properties:
- linked_interconnect_attachments
- linked_vpn_tunnels
- linked_vpc_network
- linked_producer_vpc_network
properties:
- name: 'instances'
type: Array
Expand Down Expand Up @@ -223,6 +234,7 @@ properties:
- linked_interconnect_attachments
- linked_router_appliance_instances
- linked_vpn_tunnels
- linked_producer_vpc_network
properties:
- name: 'uri'
type: String
Expand All @@ -233,13 +245,47 @@ properties:
- name: 'excludeExportRanges'
type: Array
description: IP ranges encompassing the subnets to be excluded from peering.
immutable: true
item_type:
type: String
- name: 'includeExportRanges'
type: Array
description: IP ranges allowed to be included from peering.
item_type:
type: String
- name: linkedProducerVpcNetwork
type: NestedObject
description: Producer VPC network that is associated with the spoke.
immutable: true
conflicts:
- linked_interconnect_attachments
- linked_router_appliance_instances
- linked_vpn_tunnels
- linked_vpc_network
properties:
- name: network
type: String
description: The URI of the Service Consumer VPC that the Producer VPC is peered with.
required: true
immutable: true
diff_suppress_func: 'tpgresource.CompareSelfLinkOrResourceName'
- name: peering
type: String
description: The name of the VPC peering between the Service Consumer VPC and the Producer VPC (defined in the Tenant project) which is added to the NCC hub. This peering must be in ACTIVE state.
required: true
immutable: true
- name: producerNetwork
type: String
description: The URI of the Producer VPC.
output: true
immutable: true
- name: includeExportRanges
type: Array
description: IP ranges allowed to be included from peering.
item_type:
type: String
- name: excludeExportRanges
type: Array
description: IP ranges encompassing the subnets to be excluded from peering.
item_type:
type: String
- name: 'uniqueId'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
resource "google_compute_network" "network" {
name = "{{index $.Vars "network_name"}}"
auto_create_subnetworks = false
}

resource "google_compute_global_address" "address" {
name = "{{index $.Vars "global_name"}}"
purpose = "VPC_PEERING"
address_type = "INTERNAL"
prefix_length = 16
network = google_compute_network.network.id
}

resource "google_service_networking_connection" "peering" {
network = google_compute_network.network.id
service = "servicenetworking.googleapis.com"
reserved_peering_ranges = [google_compute_global_address.address.name]
}

resource "google_network_connectivity_hub" "basic_hub" {
name = "{{index $.Vars "hub_name"}}"
}

resource "google_network_connectivity_spoke" "linked_vpc_spoke" {
name = "{{index $.Vars "spoke_name"}}"
location = "global"
hub = google_network_connectivity_hub.basic_hub.id
linked_vpc_network {
uri = google_compute_network.network.self_link
}
}

resource "google_network_connectivity_spoke" "primary" {
name = "{{index $.Vars "producer_spoke_name"}}"
location = "global"
description = "A sample spoke with a linked router appliance instance"
labels = {
label-one = "value-one"
}
hub = google_network_connectivity_hub.basic_hub.id
linked_producer_vpc_network {
network = google_compute_network.network.name
peering = google_service_networking_connection.peering.peering
exclude_export_ranges = [
"198.51.100.0/24",
"10.10.0.0/16"
]
}
depends_on = [google_network_connectivity_spoke.linked_vpc_spoke]
}