-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add edgenetwork Router resource. #12594
Open
f1urps
wants to merge
4
commits into
GoogleCloudPlatform:main
Choose a base branch
from
f1urps:edgenetwork-router
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f97a407
Add edgenetwork InterconnectAttachment resource.
f1urps c504786
Fix yaml lint for InterconnectAttachment.yaml
f1urps db40664
Add edgenetwork Router resource
f1urps 64736d5
remove optional fields from minimal example in edgenetwork Router
f1urps File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
# Copyright 2024 Google Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- | ||
name: 'InterconnectAttachment' | ||
description: | | ||
A Distributed Cloud Edge interconnect attachment, which connects routers to the northbound network. | ||
references: | ||
guides: | ||
'Create and manage interconnect attachments': 'https://cloud.google.com/distributed-cloud/edge/latest/docs/attachments#api' | ||
api: 'https://cloud.google.com/distributed-cloud/edge/latest/docs/reference/network/rest/v1/projects.locations.zones.interconnectAttachments' | ||
docs: | ||
base_url: 'projects/{{project}}/locations/{{location}}/zones/{{zone}}/interconnectAttachments' | ||
self_link: 'projects/{{project}}/locations/{{location}}/zones/{{zone}}/interconnectAttachments/{{interconnect_attachment_id}}' | ||
create_url: 'projects/{{project}}/locations/{{location}}/zones/{{zone}}/interconnectAttachments?interconnectAttachmentId={{interconnect_attachment_id}}' | ||
immutable: true | ||
import_format: | ||
- 'projects/{{project}}/locations/{{location}}/zones/{{zone}}/interconnectAttachment/{{interconnect_attachment_id}}' | ||
- '{{name}}' | ||
timeouts: | ||
insert_minutes: 20 | ||
update_minutes: 20 | ||
delete_minutes: 30 | ||
autogen_async: true | ||
async: | ||
actions: ['create', 'delete', 'update'] | ||
type: 'OpAsync' | ||
operation: | ||
base_url: '{{op_id}}' | ||
path: 'name' | ||
wait_ms: 1000 | ||
result: | ||
path: 'response' | ||
resource_inside_response: false | ||
error: | ||
path: 'error' | ||
message: 'message' | ||
examples: | ||
- name: 'edgenetwork_interconnect_attachment' | ||
primary_resource_id: 'example_interconnect_attachment' | ||
vars: | ||
edgenetwork_interconnect_attachment_id: 'example-interconnect-attachment' | ||
edgenetwork_network_id: 'example-network' | ||
test_env_vars: | ||
location: 'REGION' | ||
zone: 'ZONE' | ||
exclude_test: true | ||
parameters: | ||
- name: 'location' | ||
type: String | ||
description: | | ||
The Google Cloud region to which the target Distributed Cloud Edge zone belongs. | ||
url_param_only: true | ||
required: true | ||
immutable: true | ||
- name: 'zone' | ||
type: String | ||
description: | | ||
The name of the target Distributed Cloud Edge zone. | ||
url_param_only: true | ||
required: true | ||
immutable: true | ||
- name: 'interconnect_attachment_id' | ||
type: String | ||
description: | | ||
A unique ID that identifies this interconnect attachment. | ||
url_param_only: true | ||
required: true | ||
immutable: true | ||
properties: | ||
- name: 'name' | ||
type: String | ||
description: | | ||
The canonical name of this resource, with format | ||
`projects/{{project}}/locations/{{location}}/zones/{{zone}}/interconnectAttachments/{{interconnect_attachment_id}}` | ||
output: true | ||
- name: 'labels' | ||
type: KeyValueLabels | ||
description: | | ||
Labels associated with this resource. | ||
required: false | ||
- name: 'description' | ||
type: String | ||
description: | | ||
A free-text description of the resource. Max length 1024 characters. | ||
required: false | ||
- name: 'createTime' | ||
type: String | ||
description: | | ||
The time when the resource was created. | ||
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine | ||
fractional digits. Examples: `2014-10-02T15:01:23Z` and `2014-10-02T15:01:23.045123456Z`. | ||
output: true | ||
- name: 'updateTime' | ||
type: String | ||
description: | | ||
The time when the resource was last updated. | ||
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine | ||
fractional digits. Examples: `2014-10-02T15:01:23Z` and `2014-10-02T15:01:23.045123456Z`. | ||
output: true | ||
- name: 'interconnect' | ||
type: String | ||
description: | | ||
The ID of the underlying interconnect that this attachment's traffic will traverse through. | ||
required: true | ||
- name: 'network' | ||
type: ResourceRef | ||
description: | | ||
The ID of the network to which this interconnect attachment belongs. | ||
Must be of the form: `projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}` | ||
required: true | ||
custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.tmpl' | ||
resource: 'Network' | ||
imports: 'name' | ||
- name: 'vlanId' | ||
type: Integer | ||
description: | | ||
VLAN ID provided by user. Must be site-wise unique. | ||
required: true | ||
- name: 'mtu' | ||
type: Integer | ||
description: | | ||
IP (L3) MTU value of the virtual edge cloud. Default value is `1500`. Possible values are: `1500`, `9000`. | ||
default_value: 1500 |
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,225 @@ | ||
# Copyright 2024 Google Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- | ||
name: 'Router' | ||
description: | | ||
A Distributed Cloud Edge router, which encapsulates northbound layer-3 parameters for a zone. | ||
references: | ||
guides: | ||
'Create and manage routers': 'https://cloud.google.com/distributed-cloud/edge/latest/docs/routers#api' | ||
api: 'https://cloud.google.com/distributed-cloud/edge/latest/docs/reference/network/rest/v1/projects.locations.zones.routers' | ||
docs: | ||
base_url: 'projects/{{project}}/locations/{{location}}/zones/{{zone}}/routers' | ||
self_link: 'projects/{{project}}/locations/{{location}}/zones/{{zone}}/routers/{{router_id}}' | ||
create_url: 'projects/{{project}}/locations/{{location}}/zones/{{zone}}/routers?routerId={{router_id}}' | ||
update_verb: 'PATCH' | ||
update_mask: true | ||
import_format: | ||
- 'projects/{{project}}/locations/{{location}}/zones/{{zone}}/routers/{{router_id}}' | ||
- '{{name}}' | ||
timeouts: | ||
insert_minutes: 20 | ||
update_minutes: 20 | ||
delete_minutes: 30 | ||
autogen_async: true | ||
async: | ||
actions: ['create', 'delete', 'update'] | ||
type: 'OpAsync' | ||
operation: | ||
base_url: '{{op_id}}' | ||
path: 'name' | ||
wait_ms: 1000 | ||
result: | ||
path: 'response' | ||
resource_inside_response: false | ||
error: | ||
path: 'error' | ||
message: 'message' | ||
examples: | ||
- name: 'edgenetwork_router_minimal' | ||
primary_resource_id: 'example_router' | ||
vars: | ||
edgenetwork_router_id: 'example-router' | ||
edgenetwork_network_id: 'example-network' | ||
test_env_vars: | ||
location: 'REGION' | ||
zone: 'ZONE' | ||
exclude_test: true | ||
- name: 'edgenetwork_router_with_bgp' | ||
primary_resource_id: 'example_router' | ||
vars: | ||
edgenetwork_router_id: 'example-router' | ||
edgenetwork_interconnect_attachment_id: 'example-interconnect-attachment' | ||
edgenetwork_network_id: 'example-network' | ||
edgenetwork_subnet_id: 'example-subnet' | ||
test_env_vars: | ||
location: 'REGION' | ||
zone: 'ZONE' | ||
exclude_test: true | ||
parameters: | ||
- name: 'location' | ||
type: String | ||
description: | | ||
The Google Cloud region to which the target Distributed Cloud Edge zone belongs. | ||
url_param_only: true | ||
required: true | ||
immutable: true | ||
- name: 'zone' | ||
type: String | ||
description: | | ||
The name of the target Distributed Cloud Edge zone. | ||
url_param_only: true | ||
required: true | ||
immutable: true | ||
- name: 'router_id' | ||
type: String | ||
description: | | ||
A unique ID that identifies this router. | ||
url_param_only: true | ||
required: true | ||
immutable: true | ||
properties: | ||
- name: 'name' | ||
type: String | ||
description: | | ||
The canonical name of this resource, with format | ||
`projects/{{project}}/locations/{{location}}/zones/{{zone}}/routers/{{router_id}}` | ||
output: true | ||
- name: 'labels' | ||
type: KeyValueLabels | ||
description: | | ||
Labels associated with this resource. | ||
- name: 'description' | ||
type: String | ||
description: | | ||
A free-text description of the resource. Max length 1024 characters. | ||
- name: 'createTime' | ||
type: String | ||
description: | | ||
The time when the resource was created. | ||
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine | ||
fractional digits. Examples: `2014-10-02T15:01:23Z` and `2014-10-02T15:01:23.045123456Z`. | ||
output: true | ||
- name: 'updateTime' | ||
type: String | ||
description: | | ||
The time when the resource was last updated. | ||
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine | ||
fractional digits. Examples: `2014-10-02T15:01:23Z` and `2014-10-02T15:01:23.045123456Z`. | ||
output: true | ||
- name: 'network' | ||
type: ResourceRef | ||
description: | | ||
The ID of the network to which this router belongs. | ||
Must be of the form: `projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}` | ||
required: true | ||
custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.tmpl' | ||
resource: 'Network' | ||
imports: 'name' | ||
- name: 'interface' | ||
type: Array | ||
description: | | ||
Router interfaces, defining the zone-side layer-3 information for building the BGP session. | ||
item_type: | ||
type: NestedObject | ||
properties: | ||
- name: 'name' | ||
type: String | ||
description: | | ||
Name of this interface entry. Unique within the zone. | ||
- name: 'ipv4Cidr' | ||
type: String | ||
description: | | ||
IPv4 address and range of the interface. | ||
- name: 'ipv6Cidr' | ||
type: String | ||
description: | | ||
IPv6 address and range of the interface. | ||
- name: 'linkedInterconnectAttachment' | ||
type: ResourceRef | ||
description: | | ||
The ID of the linked interconnect attachment. | ||
Must be of the form: `projects/{{project}}/locations/{{location}}/zones/{{zone}}/interconnectAttachments/{{interconnect_attachment_id}}` | ||
custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.tmpl' | ||
resource: 'InterconnectAttachment' | ||
imports: 'name' | ||
- name: 'subnetwork' | ||
type: ResourceRef | ||
description: | | ||
The ID of the subnetwork that this interface belongs to. | ||
Must be of the form: `projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}` | ||
custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.tmpl' | ||
resource: 'Subnet' | ||
imports: 'name' | ||
- name: 'loopbackIpAddresses' | ||
type: Array | ||
description: | | ||
Creates loopback interfaces in the router when specified. The number of IP addresses must match the number of TOR devices. | ||
item_type: | ||
type: String | ||
- name: 'bgpPeer' | ||
type: Array | ||
description: | | ||
BGP Peers, defining the peer-side layer-3 information for building the BGP session. | ||
item_type: | ||
type: NestedObject | ||
properties: | ||
- name: 'name' | ||
type: String | ||
description: | | ||
Name of this BGP peer. Unique within the zone. | ||
- name: 'interface' | ||
type: String | ||
description: | | ||
Name of the interface entry that this peer is associated with. | ||
- name: 'interfaceIpv4Cidr' | ||
type: String | ||
description: | | ||
IPv4 range of the interface within Google. | ||
- name: 'interfaceIpv6Cidr' | ||
type: String | ||
description: | | ||
IPv6 range of the interface within Google. | ||
- name: 'peerIpv4Cidr' | ||
type: String | ||
description: | | ||
IPv4 range of the BGP interface outside Google. | ||
- name: 'peerIpv6Cidr' | ||
type: String | ||
description: | | ||
IPv6 range of the BGP interface outside Google. | ||
- name: 'peerAsn' | ||
type: Integer | ||
description: | | ||
Peer BGP autonomous system number (ASN). Each BGP interface may use a different value. | ||
- name: 'bgp' | ||
type: NestedObject | ||
description: | | ||
BGP information specific to this router. | ||
properties: | ||
- name: 'asn' | ||
type: Integer | ||
description: | | ||
Locally assigned BGP ASN. | ||
- name: 'keepaliveIntervalInSeconds' | ||
type: Integer | ||
description: | | ||
The interval in seconds between BGP keepalive messages that are sent to the peer. Default value is `20`. Must be between `20` and `60`. | ||
default_value: 20 | ||
- name: 'routeAdvertisements' | ||
type: Array | ||
description: | | ||
A list of CIDRs in IP/Length format to advertise northbound as static routes from this router. | ||
item_type: | ||
type: String |
23 changes: 23 additions & 0 deletions
23
mmv1/templates/terraform/examples/edgenetwork_interconnect_attachment.tf.tmpl
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,23 @@ | ||
|
||
resource "google_edgenetwork_interconnect_attachment" "{{$.PrimaryResourceId}}" { | ||
interconnect_attachment_id = "{{index $.Vars "edgenetwork_interconnect_attachment_id"}}" | ||
location = "{{index $.TestEnvVars "location"}}" | ||
zone = "{{index $.TestEnvVars "zone"}}" | ||
description = "Example interconnect attachment." | ||
network = google_edgenetwork_network.example_network.id | ||
interconnect = "11111111-2222-3333-4444-555555555555" | ||
vlan_id = 55 | ||
mtu = 9000 | ||
labels = { | ||
"environment" : "dev" | ||
} | ||
} | ||
|
||
resource "google_edgenetwork_network" "example_network" { | ||
network_id = "{{index $.Vars "edgenetwork_network_id"}}" | ||
location = "{{index $.TestEnvVars "location"}}" | ||
zone = "{{index $.TestEnvVars "zone"}}" | ||
description = "Example network." | ||
mtu = 9000 | ||
} | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: I'm still seeing a lot of
required: false
which is creating some noise when reading