Files
hunfabric/modules/net-vpc-peering
Hemanand eaa420534b Add agent engine BYOC support (#3885)
* feat(agent-engine): add support for container and custom image specs

- Add container_config to deployment_files.
- Add image_spec with build_args to source_config.
- Make agent_framework optional and document supported values.
- Implement dynamic specs for container and source deployments.
- Add examples and automated tests for new deployment types.

* chore: update Google provider version to 7.28.0 across modules

Mechanical update of versions.tf and versions.tofu files using tools/versions.py.

* feat(agent-engine): refactor for container deployments and API alignment

- Group deployment settings under 'deployment_config' (renamed from 'deployment_files').
- Support container-based deployments via 'container_config' and 'image_spec'.
- Refactor 'source_files_config' (renamed from 'source_config') to include mutually exclusive 'python_spec' and 'image_spec'.
- Support 'developer_connect_config' as a source code type.
- Group engine settings (framework, env, secrets) under 'agent_engine_config'.
- Add support for 'memory_bank_config' persistent memory.
- Overhaul reasoning engine resources with dynamic blocks to match provider schema.
- Update all documentation examples, add TOC, and refresh test inventories.

* Update dynamic python_spec block and related example yamls

* Ignore changes setting for developer_connect_source under lifecycle management

* fixing review comments for `try` and default path for `source_path`

---------

Co-authored-by: Hemanand <hemr@google.com>
Co-authored-by: Julio Castillo <jccb@google.com>
2026-04-21 17:46:20 +00:00
..
2022-01-01 15:52:31 +01:00

Google Network Peering

This module allows creation of a VPC Network Peering between two networks.

The resources created/managed by this module are:

  • one network peering from local network to peer network
  • one network peering from peer network to local network

Examples

Basic Usage

Basic usage of this module is as follows:

module "peering" {
  source        = "./fabric/modules/net-vpc-peering"
  prefix        = "name-prefix"
  local_network = "projects/project-1/global/networks/vpc-1"
  peer_network  = "projects/project-1/global/networks/vpc-2"
}
# tftest modules=1 resources=2

Multiple Peerings

If you need to create more than one peering for the same VPC Network (A -> B, A -> C) you use a depends_on for second one to keep order of peering creation (It is not currently possible to create more than one peering connection for a VPC Network at the same time).

module "peering-a-b" {
  source        = "./fabric/modules/net-vpc-peering"
  prefix        = "name-prefix"
  local_network = "projects/project-a/global/networks/vpc-a"
  peer_network  = "projects/project-b/global/networks/vpc-b"
}

module "peering-a-c" {
  source        = "./fabric/modules/net-vpc-peering"
  prefix        = "name-prefix"
  local_network = "projects/project-a/global/networks/vpc-a"
  peer_network  = "projects/project-c/global/networks/vpc-c"
  depends_on    = [module.peering-a-b]
}
# tftest modules=2 resources=4

Route Configuration

You can control export/import of routes in both the local and peer via the routes_config variable. Defaults are to import and export from both sides, when the peer side only configured if the peering is managed by the module via peer_create_peering.

module "peering" {
  source        = "./fabric/modules/net-vpc-peering"
  prefix        = "name-prefix"
  local_network = "projects/project-1/global/networks/vpc-1"
  peer_network  = "projects/project-1/global/networks/vpc-2"
  routes_config = {
    local = {
      import = false
    }
  }
}
# tftest modules=1 resources=2  inventory=route-config.yaml

Variables

name description type required default
local_network Resource link of the network to add a peering to. string
peer_network Resource link of the peer network. string
name Optional names for the the peering resources. If not set, peering names will be generated based on the network names. object({…}) {}
peer_create_peering Create the peering on the remote side. If false, only the peering from this network to the remote network is created. bool true
prefix Optional name prefix for the network peerings. string null
routes_config Control import/export for local and remote peer. Remote configuration is only used when creating remote peering. object({…}) {}
stack_type IP version(s) of traffic and routes that are allowed to be imported or exported between peer networks. Possible values: IPV4_ONLY, IPV4_IPV6. string null

Outputs

name description sensitive
local_network_peering Network peering resource.
peer_network_peering Peer network peering resource.