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

Unable to create cloud private nat on gcp using google_compute_router_nat #169

Open
Pthuturkar opened this issue Oct 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Pthuturkar
Copy link

Pthuturkar commented Oct 23, 2024

TL;DR

Description: type parameter is not working in the resource google_compute_router_nat

Reference : https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_router_nat#example-usage---router-nat-private

Expected behavior

Resource should be able to create private cloud nat on gcp

Observed behavior

error : Error: Unsupported argument

│ on .terraform/modules/cloud-nat-test/cloud_nat.tf line 20, in resource "google_compute_router_nat" "cloud_nat":
│ 20: type = "PRIVATE"

│ An argument named "type" is not expected here.

Terraform Configuration

resource "google_compute_router_nat" "cloud_nat" {
  project                             = var.project_id
  name                                = var.cloud_nat_name
  router                              = google_compute_router.router.name
  region                              = google_compute_router.router.region
  source_subnetwork_ip_ranges_to_nat  = var.source_subnetwork_ip_ranges_to_nat
  enable_endpoint_independent_mapping = var.enable_endpoint_independent_mapping
  min_ports_per_vm                    = var.min_ports_per_vm
  nat_ip_allocate_option              = var.nat_ip_allocate_option
  type                                = "PRIVATE"
  subnetwork {
    name                    = google_compute_subnetwork.subnet.id
    source_ip_ranges_to_nat = ["ALL_IP_RANGES"]
  }
  rules {
    rule_number = var.rule_number
    description = "rule for private nat"
    match       = var.match
    action {
      source_nat_active_ranges = [
        data.google_compute_subnetwork.vpc_subnetwork.id
      ]
    }
  }
}

Terraform Version

terraform {
  required_providers {
    google = {
       source  = "hashicorp/google"
       version = "6.4.0"
    }
  }
}

Additional information

No response

@Pthuturkar Pthuturkar added the bug Something isn't working label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant