https://github.com/global-vmware/vcd_nsxt_nat_rule
This Repository contains the "vcd_nsxt_nat_rule" Terraform Module. You can use this Module to deploy NSX-T Edge Gateway NAT Rules into a VMware Cloud Director (VCD) Environment.
https://github.com/global-vmware/vcd_nsxt_nat_rule
infrastructure-as-code networking terraform terraform-module vmware vmware-nsx
Last synced: 11 months ago
JSON representation
This Repository contains the "vcd_nsxt_nat_rule" Terraform Module. You can use this Module to deploy NSX-T Edge Gateway NAT Rules into a VMware Cloud Director (VCD) Environment.
- Host: GitHub
- URL: https://github.com/global-vmware/vcd_nsxt_nat_rule
- Owner: global-vmware
- Created: 2023-05-05T19:36:34.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-11T21:27:09.000Z (over 2 years ago)
- Last Synced: 2025-03-27T15:53:55.624Z (about 1 year ago)
- Topics: infrastructure-as-code, networking, terraform, terraform-module, vmware, vmware-nsx
- Language: HCL
- Homepage: https://www.rackspace.com/cloud/vmware
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## VCD NSX-T Edge Gateway NAT Rules Terraform Module
This Terraform module will deploy NSX-T Edge Gateway NAT Rules into an existing VMware Cloud Director (VCD) Environment. This module can be used to provision new NAT Rules into [Rackspace Technology SDDC Flex](https://www.rackspace.com/cloud/private/software-defined-data-center-flex) VCD Data Center Regions.
## Requirements
| Name | Version |
|-----------|---------|
| terraform | ~> 1.2 |
| vcd | ~> 3.8.2 |
## Resources
| Name | Type |
|------------------------------------------------------------------|-----------|
| [vcd_vdc_group](https://registry.terraform.io/providers/vmware/vcd/3.8.2/docs/data-sources/vdc_group) | data source |
| [vcd_nsxt_edgegateway](https://registry.terraform.io/providers/vmware/vcd/3.8.2/docs/data-sources/nsxt_edgegateway) | data source |
| [vcd_nsxt_nat_rule](https://registry.terraform.io/providers/vmware/vcd/3.8.2/docs/resources/nsxt_nat_rule) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|-------------------------------|----------------------------------------------------------------------|--------|-------------------|----------|
| vdc_org_name | The name of the Data Center Group Organization in VCD | string | `"Organization Name Format: --"` | yes |
| vdc_group_name | The name of the Data Center Group in VCD | string | `"Data Center Group Name Format: -- "` | yes |
| vdc_edge_name | Name of the Data Center Group Edge Gateway | string | `"Edge Gateway Name Format: ---"` | yes |
| nat_rules | Map of NAT rules to create | map(object({
rule_type = string
name = string
description = optional(string)
external_address = optional(string)
internal_address = optional(string)
snat_destination_address = optional(string)
dnat_external_port = optional(string)
app_port_profile_id = optional(string)
logging = optional(bool)
firewall_match = optional(string)
priority = optional(number)
})) | N/A | yes |
## Outputs
| Name | Description |
|--------------|-------------------------|
| nat_rules | The NAT rules created |
## Example Usage
This is an example of a `main.tf` file that uses the `"github.com/global-vmware/vcd_nsxt_nat_rule"` Module source to create NAT rules for an NSX-T Edge Gateway in a VMware Cloud Director environment:
```terraform
module "vcd_nsxt_nat_rule" {
source = "github.com/global-vmware/vcd_nsxt_nat_rule.git?ref=v1.3.2"
vdc_org_name = ""
vdc_group_name = ""
vdc_edge_name = ""
nat_rules = {
"192.168.0.0/24_SNAT" = {
rule_type = "SNAT"
name = "172.16.0.0/24_SNAT"
external_address = "8.8.8.8"
internal_address = "172.16.0.0/24"
logging = false
},
"192.168.0.10_DNAT-HTTP" = {
rule_type = "DNAT"
name = "172.16.0.10_DNAT-HTTP"
external_address = "8.8.8.8"
internal_address = "172.16.0.10"
dnat_external_port = "80"
logging = false
}
}
}
```
## Authors
This module is maintained by the [Global VMware Cloud Automation Services Team](https://github.com/global-vmware).