FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects

Change module to create a single dual-nic NAT

Merged Robin Goodall requested to merge two-nics into master
1 unresolved thread

Adding support for both multiple single-nic NATs and a single dual-nic NATs at once was going to be more trouble than it was worth.

This changes the module to provide a single NAT (in a managed instance group) that has two network interfaces:

  1. Shared VPC network
  2. cluster network

Requires:

  • Cluster IP address (should probably be created with a google_compute_address resource
  • Shared VPC Project ID
  • Shared VPC Subnetwork (like 'uis-moodle-dev')

See https://gitlab.developers.cam.ac.uk/uis/moodle/moodle-cloud/deployment/-/issues/72 for its use.

Closes: #2 (closed)

Dynamically gets interface names so... closes: #1 (closed)

Merge request reports

Pipeline #34347 passed

Pipeline passed for e7d87a5c on two-nics

Approved by

Merged by Sam WenhamSam Wenham 4 years ago (Jun 29, 2020 10:57am UTC)

Loading

Pipeline #34351 passed

Pipeline passed for 1d8f9431 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 # Instance template to create NAT(s)
2 # See https://cloud.google.com/vpc/docs/special-configurations#multiple-natgateways for more information
3 resource "google_compute_instance_template" "nat" {
4 count = var.size
1 # Instance template to create a NAT VM with two network interfaces
5 2
6 project = var.project
7 name = "${var.nat_name}-${count.index + 1}"
3 resource "google_compute_instance_template" "nat" {
4 project = var.project
5 name_prefix = "${var.name}-"
  • Robin Goodall added 1 commit

    added 1 commit

    • e7d87a5c - IGM lifecycle to aid updating

    Compare with previous version

  • Sam Wenham approved this merge request

    approved this merge request

  • Sam Wenham mentioned in commit 1d8f9431

    mentioned in commit 1d8f9431

  • merged

  • Please register or sign in to reply
    Loading