diff --git a/metadata.yaml b/metadata.yaml new file mode 100644 index 0000000..b0a77af --- /dev/null +++ b/metadata.yaml @@ -0,0 +1,122 @@ +# Copyright 2024 Google LLC +# +# 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. + +apiVersion: blueprints.cloud.google.com/v1alpha1 +kind: BlueprintMetadata +metadata: + name: terraform-google-cloud-router + annotations: + config.kubernetes.io/local-config: "true" +spec: + info: + source: + repo: https://github.com/terraform-google-modules/terraform-google-cloud-router.git + sourceType: git + version: 6.0.2 + actuationTool: + flavor: Terraform + version: ">= 1.3" + description: {} + content: + subBlueprints: + - name: interconnect_attachment + location: modules/interconnect_attachment + - name: interface + location: modules/interface + examples: + - name: interconnect_attachment + location: examples/interconnect_attachment + - name: nat + location: examples/nat + - name: simple_example + location: examples/simple_example + interfaces: + variables: + - name: bgp + description: BGP information specific to this router. + varType: |- + object({ + asn = string + advertise_mode = optional(string, "CUSTOM") + advertised_groups = optional(list(string)) + advertised_ip_ranges = optional(list(object({ + range = string + description = optional(string) + })), []) + keepalive_interval = optional(number) + }) + - name: description + description: An optional description of this resource + varType: string + - name: name + description: Name of the router + varType: string + required: true + - name: nats + description: NATs to deploy on this router. + varType: |- + list(object({ + name = string + nat_ip_allocate_option = optional(string) + source_subnetwork_ip_ranges_to_nat = optional(string) + nat_ips = optional(list(string), []) + min_ports_per_vm = optional(number) + max_ports_per_vm = optional(number) + udp_idle_timeout_sec = optional(number) + icmp_idle_timeout_sec = optional(number) + tcp_established_idle_timeout_sec = optional(number) + tcp_transitory_idle_timeout_sec = optional(number) + tcp_time_wait_timeout_sec = optional(number) + enable_endpoint_independent_mapping = optional(bool) + enable_dynamic_port_allocation = optional(bool) + + log_config = optional(object({ + enable = optional(bool, true) + filter = optional(string, "ALL") + }), {}) + + subnetworks = optional(list(object({ + name = string + source_ip_ranges_to_nat = list(string) + secondary_ip_range_names = optional(list(string)) + })), []) + + })) + defaultValue: [] + - name: network + description: A reference to the network to which this router belongs + varType: string + required: true + - name: project + description: The project ID to deploy to + varType: string + required: true + - name: region + description: Region where the router resides + varType: string + required: true + outputs: + - name: nat + description: Created NATs + - name: router + description: Created Router + requirements: + roles: + - level: Project + roles: + - roles/owner + services: + - cloudresourcemanager.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com diff --git a/modules/interconnect_attachment/README.md b/modules/interconnect_attachment/README.md index 56210cb..102608f 100644 --- a/modules/interconnect_attachment/README.md +++ b/modules/interconnect_attachment/README.md @@ -1,4 +1,4 @@ -# Cloud Router Terraform Module +# Interconnect Attachment ## Inputs diff --git a/modules/interconnect_attachment/metadata.yaml b/modules/interconnect_attachment/metadata.yaml index 67d737c..6793867 100644 --- a/modules/interconnect_attachment/metadata.yaml +++ b/modules/interconnect_attachment/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ metadata: config.kubernetes.io/local-config: "true" spec: info: - title: Cloud Router Terraform Module + title: Interconnect Attachment source: repo: https://github.com/terraform-google-modules/terraform-google-cloud-router.git sourceType: git diff --git a/modules/interface/README.md b/modules/interface/README.md new file mode 100644 index 0000000..b721dee --- /dev/null +++ b/modules/interface/README.md @@ -0,0 +1,21 @@ +# Interface + + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| interconnect\_attachment | The name or resource link to the VLAN interconnect for this interface | `string` | `null` | no | +| ip\_range | IP address and range of the interface | `string` | `null` | no | +| name | The name of the interface | `string` | n/a | yes | +| peers | BGP peers for this interface. |
list(object({
name = string
peer_ip_address = string
peer_asn = string
advertised_route_priority = optional(number)
bfd = object({
session_initialization_mode = string
min_transmit_interval = optional(number)
min_receive_interval = optional(number)
multiplier = optional(number)
})
}))
| `[]` | no | +| project | The project ID to deploy to | `string` | n/a | yes | +| region | Region where the interface resides | `string` | n/a | yes | +| router | Name of the router the interface resides | `string` | n/a | yes | +| vpn\_tunnel | The name or resource link to the VPN tunnel this interface will be linked to | `string` | `null` | no | + +## Outputs + +No outputs. + + diff --git a/modules/interface/metadata.yaml b/modules/interface/metadata.yaml new file mode 100644 index 0000000..1144e65 --- /dev/null +++ b/modules/interface/metadata.yaml @@ -0,0 +1,92 @@ +# Copyright 2024 Google LLC +# +# 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. + +apiVersion: blueprints.cloud.google.com/v1alpha1 +kind: BlueprintMetadata +metadata: + name: terraform-google-cloud-router-interface + annotations: + config.kubernetes.io/local-config: "true" +spec: + info: + title: Interface + source: + repo: https://github.com/terraform-google-modules/terraform-google-cloud-router.git + sourceType: git + dir: /modules/interface + version: 6.0.2 + actuationTool: + flavor: Terraform + version: ">= 1.3" + description: {} + content: + examples: + - name: interconnect_attachment + location: examples/interconnect_attachment + - name: nat + location: examples/nat + - name: simple_example + location: examples/simple_example + interfaces: + variables: + - name: interconnect_attachment + description: The name or resource link to the VLAN interconnect for this interface + varType: string + - name: ip_range + description: IP address and range of the interface + varType: string + - name: name + description: The name of the interface + varType: string + required: true + - name: peers + description: BGP peers for this interface. + varType: |- + list(object({ + name = string + peer_ip_address = string + peer_asn = string + advertised_route_priority = optional(number) + bfd = object({ + session_initialization_mode = string + min_transmit_interval = optional(number) + min_receive_interval = optional(number) + multiplier = optional(number) + }) + })) + defaultValue: [] + - name: project + description: The project ID to deploy to + varType: string + required: true + - name: region + description: Region where the interface resides + varType: string + required: true + - name: router + description: Name of the router the interface resides + varType: string + required: true + - name: vpn_tunnel + description: The name or resource link to the VPN tunnel this interface will be linked to + varType: string + requirements: + roles: + - level: Project + roles: + - roles/owner + services: + - cloudresourcemanager.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com