1. Packages
  2. Vcd Provider
  3. API Docs
  4. getNsxvSnat
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

vcd.getNsxvSnat

Explore with Pulumi AI

vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

Provides a VMware Cloud Director SNAT data source for advanced edge gateways (NSX-V). This can be used to read existing rule by ID and use its attributes in other resources.

Note: This data source requires advanced edge gateway.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vcd from "@pulumi/vcd";

const my_rule = vcd.getNsxvSnat({
    edgeGateway: "my-edge-gw",
    org: "my-org",
    ruleId: "197867",
    vdc: "my-org-vdc",
});
Copy
import pulumi
import pulumi_vcd as vcd

my_rule = vcd.get_nsxv_snat(edge_gateway="my-edge-gw",
    org="my-org",
    rule_id="197867",
    vdc="my-org-vdc")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vcd/v3/vcd"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vcd.LookupNsxvSnat(ctx, &vcd.LookupNsxvSnatArgs{
			EdgeGateway: "my-edge-gw",
			Org:         pulumi.StringRef("my-org"),
			RuleId:      "197867",
			Vdc:         pulumi.StringRef("my-org-vdc"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vcd = Pulumi.Vcd;

return await Deployment.RunAsync(() => 
{
    var my_rule = Vcd.GetNsxvSnat.Invoke(new()
    {
        EdgeGateway = "my-edge-gw",
        Org = "my-org",
        RuleId = "197867",
        Vdc = "my-org-vdc",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vcd.VcdFunctions;
import com.pulumi.vcd.inputs.GetNsxvSnatArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var my-rule = VcdFunctions.getNsxvSnat(GetNsxvSnatArgs.builder()
            .edgeGateway("my-edge-gw")
            .org("my-org")
            .ruleId("197867")
            .vdc("my-org-vdc")
            .build());

    }
}
Copy
variables:
  my-rule:
    fn::invoke:
      function: vcd:getNsxvSnat
      arguments:
        edgeGateway: my-edge-gw
        org: my-org
        ruleId: '197867'
        vdc: my-org-vdc
Copy

Using getNsxvSnat

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getNsxvSnat(args: GetNsxvSnatArgs, opts?: InvokeOptions): Promise<GetNsxvSnatResult>
function getNsxvSnatOutput(args: GetNsxvSnatOutputArgs, opts?: InvokeOptions): Output<GetNsxvSnatResult>
Copy
def get_nsxv_snat(edge_gateway: Optional[str] = None,
                  id: Optional[str] = None,
                  org: Optional[str] = None,
                  rule_id: Optional[str] = None,
                  vdc: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetNsxvSnatResult
def get_nsxv_snat_output(edge_gateway: Optional[pulumi.Input[str]] = None,
                  id: Optional[pulumi.Input[str]] = None,
                  org: Optional[pulumi.Input[str]] = None,
                  rule_id: Optional[pulumi.Input[str]] = None,
                  vdc: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetNsxvSnatResult]
Copy
func LookupNsxvSnat(ctx *Context, args *LookupNsxvSnatArgs, opts ...InvokeOption) (*LookupNsxvSnatResult, error)
func LookupNsxvSnatOutput(ctx *Context, args *LookupNsxvSnatOutputArgs, opts ...InvokeOption) LookupNsxvSnatResultOutput
Copy

> Note: This function is named LookupNsxvSnat in the Go SDK.

public static class GetNsxvSnat 
{
    public static Task<GetNsxvSnatResult> InvokeAsync(GetNsxvSnatArgs args, InvokeOptions? opts = null)
    public static Output<GetNsxvSnatResult> Invoke(GetNsxvSnatInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetNsxvSnatResult> getNsxvSnat(GetNsxvSnatArgs args, InvokeOptions options)
public static Output<GetNsxvSnatResult> getNsxvSnat(GetNsxvSnatArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: vcd:index/getNsxvSnat:getNsxvSnat
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

EdgeGateway This property is required. string
The name of the edge gateway on which to apply the SNAT rule.
RuleId This property is required. string
ID of SNAT rule as shown in the UI.
Id string
Org string
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
Vdc string
The name of VDC to use, optional if defined at provider level.
EdgeGateway This property is required. string
The name of the edge gateway on which to apply the SNAT rule.
RuleId This property is required. string
ID of SNAT rule as shown in the UI.
Id string
Org string
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
Vdc string
The name of VDC to use, optional if defined at provider level.
edgeGateway This property is required. String
The name of the edge gateway on which to apply the SNAT rule.
ruleId This property is required. String
ID of SNAT rule as shown in the UI.
id String
org String
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
vdc String
The name of VDC to use, optional if defined at provider level.
edgeGateway This property is required. string
The name of the edge gateway on which to apply the SNAT rule.
ruleId This property is required. string
ID of SNAT rule as shown in the UI.
id string
org string
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
vdc string
The name of VDC to use, optional if defined at provider level.
edge_gateway This property is required. str
The name of the edge gateway on which to apply the SNAT rule.
rule_id This property is required. str
ID of SNAT rule as shown in the UI.
id str
org str
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
vdc str
The name of VDC to use, optional if defined at provider level.
edgeGateway This property is required. String
The name of the edge gateway on which to apply the SNAT rule.
ruleId This property is required. String
ID of SNAT rule as shown in the UI.
id String
org String
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
vdc String
The name of VDC to use, optional if defined at provider level.

getNsxvSnat Result

The following output properties are available:

Description string
EdgeGateway string
Enabled bool
Id string
LoggingEnabled bool
NetworkName string
NetworkType string
OriginalAddress string
RuleId string
RuleTag double
RuleType string
TranslatedAddress string
Org string
Vdc string
Description string
EdgeGateway string
Enabled bool
Id string
LoggingEnabled bool
NetworkName string
NetworkType string
OriginalAddress string
RuleId string
RuleTag float64
RuleType string
TranslatedAddress string
Org string
Vdc string
description String
edgeGateway String
enabled Boolean
id String
loggingEnabled Boolean
networkName String
networkType String
originalAddress String
ruleId String
ruleTag Double
ruleType String
translatedAddress String
org String
vdc String
description string
edgeGateway string
enabled boolean
id string
loggingEnabled boolean
networkName string
networkType string
originalAddress string
ruleId string
ruleTag number
ruleType string
translatedAddress string
org string
vdc string
description String
edgeGateway String
enabled Boolean
id String
loggingEnabled Boolean
networkName String
networkType String
originalAddress String
ruleId String
ruleTag Number
ruleType String
translatedAddress String
org String
vdc String

Package Details

Repository
vcd vmware/terraform-provider-vcd
License
Notes
This Pulumi package is based on the vcd Terraform Provider.
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware