Cloud NAT rules support

This commit is contained in:
Julio Castillo
2023-05-12 16:20:38 +02:00
parent b153474468
commit d20a078134
4 changed files with 143 additions and 33 deletions

View File

@@ -1,5 +1,5 @@
/**
* Copyright 2022 Google LLC
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -63,5 +63,17 @@ resource "google_compute_router_nat" "nat" {
secondary_ip_range_names = subnetwork.value.secondary_ranges
}
}
dynamic "rules" {
for_each = { for i, r in var.rules : i => r }
content {
rule_number = rules.key
description = rules.value.description
match = rules.value.match
action {
source_nat_active_ips = rules.value.source_ips
}
}
}
}