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

vcd.getNsxvFirewallRule

Explore with Pulumi AI

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

    Provides a VMware Cloud Director firewall rule data source for advanced edge gateways (NSX-V). This can be used to read existing rules 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.getNsxvFirewallRule({
        edgeGateway: "my-edge-gw",
        org: "my-org",
        ruleId: "133048",
        vdc: "my-org-vdc",
    });
    
    import pulumi
    import pulumi_vcd as vcd
    
    my_rule = vcd.get_nsxv_firewall_rule(edge_gateway="my-edge-gw",
        org="my-org",
        rule_id="133048",
        vdc="my-org-vdc")
    
    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.LookupNsxvFirewallRule(ctx, &vcd.LookupNsxvFirewallRuleArgs{
    			EdgeGateway: "my-edge-gw",
    			Org:         pulumi.StringRef("my-org"),
    			RuleId:      "133048",
    			Vdc:         pulumi.StringRef("my-org-vdc"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vcd = Pulumi.Vcd;
    
    return await Deployment.RunAsync(() => 
    {
        var my_rule = Vcd.GetNsxvFirewallRule.Invoke(new()
        {
            EdgeGateway = "my-edge-gw",
            Org = "my-org",
            RuleId = "133048",
            Vdc = "my-org-vdc",
        });
    
    });
    
    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.GetNsxvFirewallRuleArgs;
    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.getNsxvFirewallRule(GetNsxvFirewallRuleArgs.builder()
                .edgeGateway("my-edge-gw")
                .org("my-org")
                .ruleId("133048")
                .vdc("my-org-vdc")
                .build());
    
        }
    }
    
    variables:
      my-rule:
        fn::invoke:
          function: vcd:getNsxvFirewallRule
          arguments:
            edgeGateway: my-edge-gw
            org: my-org
            ruleId: '133048'
            vdc: my-org-vdc
    

    Using getNsxvFirewallRule

    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 getNsxvFirewallRule(args: GetNsxvFirewallRuleArgs, opts?: InvokeOptions): Promise<GetNsxvFirewallRuleResult>
    function getNsxvFirewallRuleOutput(args: GetNsxvFirewallRuleOutputArgs, opts?: InvokeOptions): Output<GetNsxvFirewallRuleResult>
    def get_nsxv_firewall_rule(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) -> GetNsxvFirewallRuleResult
    def get_nsxv_firewall_rule_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[GetNsxvFirewallRuleResult]
    func LookupNsxvFirewallRule(ctx *Context, args *LookupNsxvFirewallRuleArgs, opts ...InvokeOption) (*LookupNsxvFirewallRuleResult, error)
    func LookupNsxvFirewallRuleOutput(ctx *Context, args *LookupNsxvFirewallRuleOutputArgs, opts ...InvokeOption) LookupNsxvFirewallRuleResultOutput

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

    public static class GetNsxvFirewallRule 
    {
        public static Task<GetNsxvFirewallRuleResult> InvokeAsync(GetNsxvFirewallRuleArgs args, InvokeOptions? opts = null)
        public static Output<GetNsxvFirewallRuleResult> Invoke(GetNsxvFirewallRuleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNsxvFirewallRuleResult> getNsxvFirewallRule(GetNsxvFirewallRuleArgs args, InvokeOptions options)
    public static Output<GetNsxvFirewallRuleResult> getNsxvFirewallRule(GetNsxvFirewallRuleArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vcd:index/getNsxvFirewallRule:getNsxvFirewallRule
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EdgeGateway string
    The name of the edge gateway on which to apply the DNAT rule.
    RuleId string
    ID of firewall rule (not UI number). See more information about firewall rule ID in vcd.NsxvFirewallRule import section.
    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 string
    The name of the edge gateway on which to apply the DNAT rule.
    RuleId string
    ID of firewall rule (not UI number). See more information about firewall rule ID in vcd.NsxvFirewallRule import section.
    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 String
    The name of the edge gateway on which to apply the DNAT rule.
    ruleId String
    ID of firewall rule (not UI number). See more information about firewall rule ID in vcd.NsxvFirewallRule import section.
    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 string
    The name of the edge gateway on which to apply the DNAT rule.
    ruleId string
    ID of firewall rule (not UI number). See more information about firewall rule ID in vcd.NsxvFirewallRule import section.
    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 str
    The name of the edge gateway on which to apply the DNAT rule.
    rule_id str
    ID of firewall rule (not UI number). See more information about firewall rule ID in vcd.NsxvFirewallRule import section.
    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 String
    The name of the edge gateway on which to apply the DNAT rule.
    ruleId String
    ID of firewall rule (not UI number). See more information about firewall rule ID in vcd.NsxvFirewallRule import section.
    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.

    getNsxvFirewallRule Result

    The following output properties are available:

    Supporting Types

    GetNsxvFirewallRuleDestination

    Exclude bool
    GatewayInterfaces List<string>
    IpAddresses List<string>
    IpSets List<string>
    OrgNetworks List<string>
    VmIds List<string>
    Exclude bool
    GatewayInterfaces []string
    IpAddresses []string
    IpSets []string
    OrgNetworks []string
    VmIds []string
    exclude Boolean
    gatewayInterfaces List<String>
    ipAddresses List<String>
    ipSets List<String>
    orgNetworks List<String>
    vmIds List<String>
    exclude boolean
    gatewayInterfaces string[]
    ipAddresses string[]
    ipSets string[]
    orgNetworks string[]
    vmIds string[]
    exclude bool
    gateway_interfaces Sequence[str]
    ip_addresses Sequence[str]
    ip_sets Sequence[str]
    org_networks Sequence[str]
    vm_ids Sequence[str]
    exclude Boolean
    gatewayInterfaces List<String>
    ipAddresses List<String>
    ipSets List<String>
    orgNetworks List<String>
    vmIds List<String>

    GetNsxvFirewallRuleService

    Port string
    Protocol string
    SourcePort string
    Port string
    Protocol string
    SourcePort string
    port String
    protocol String
    sourcePort String
    port string
    protocol string
    sourcePort string
    port String
    protocol String
    sourcePort String

    GetNsxvFirewallRuleSource

    Exclude bool
    GatewayInterfaces List<string>
    IpAddresses List<string>
    IpSets List<string>
    OrgNetworks List<string>
    VmIds List<string>
    Exclude bool
    GatewayInterfaces []string
    IpAddresses []string
    IpSets []string
    OrgNetworks []string
    VmIds []string
    exclude Boolean
    gatewayInterfaces List<String>
    ipAddresses List<String>
    ipSets List<String>
    orgNetworks List<String>
    vmIds List<String>
    exclude boolean
    gatewayInterfaces string[]
    ipAddresses string[]
    ipSets string[]
    orgNetworks string[]
    vmIds string[]
    exclude bool
    gateway_interfaces Sequence[str]
    ip_addresses Sequence[str]
    ip_sets Sequence[str]
    org_networks Sequence[str]
    vm_ids Sequence[str]
    exclude Boolean
    gatewayInterfaces List<String>
    ipAddresses List<String>
    ipSets List<String>
    orgNetworks List<String>
    vmIds List<String>

    Package Details

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