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

vcd.getNsxtDistributedFirewallRule

Explore with Pulumi AI

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

    The Distributed Firewall data source reads a single rule for a particular VDC Group.

    There is a different data source vcd.NsxtDistributedFirewall resource available that can fetch all firewall rules.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vcd from "@pulumi/vcd";
    
    const g1 = vcd.getVdcGroup({
        org: "my-org",
        name: "my-vdc-group",
    });
    const r1 = g1.then(g1 => vcd.getNsxtDistributedFirewallRule({
        org: "my-org",
        vdcGroupId: g1.id,
        name: "rule1",
    }));
    
    import pulumi
    import pulumi_vcd as vcd
    
    g1 = vcd.get_vdc_group(org="my-org",
        name="my-vdc-group")
    r1 = vcd.get_nsxt_distributed_firewall_rule(org="my-org",
        vdc_group_id=g1.id,
        name="rule1")
    
    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 {
    		g1, err := vcd.LookupVdcGroup(ctx, &vcd.LookupVdcGroupArgs{
    			Org:  pulumi.StringRef("my-org"),
    			Name: pulumi.StringRef("my-vdc-group"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = vcd.LookupNsxtDistributedFirewallRule(ctx, &vcd.LookupNsxtDistributedFirewallRuleArgs{
    			Org:        pulumi.StringRef("my-org"),
    			VdcGroupId: g1.Id,
    			Name:       "rule1",
    		}, 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 g1 = Vcd.GetVdcGroup.Invoke(new()
        {
            Org = "my-org",
            Name = "my-vdc-group",
        });
    
        var r1 = Vcd.GetNsxtDistributedFirewallRule.Invoke(new()
        {
            Org = "my-org",
            VdcGroupId = g1.Apply(getVdcGroupResult => getVdcGroupResult.Id),
            Name = "rule1",
        });
    
    });
    
    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.GetVdcGroupArgs;
    import com.pulumi.vcd.inputs.GetNsxtDistributedFirewallRuleArgs;
    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 g1 = VcdFunctions.getVdcGroup(GetVdcGroupArgs.builder()
                .org("my-org")
                .name("my-vdc-group")
                .build());
    
            final var r1 = VcdFunctions.getNsxtDistributedFirewallRule(GetNsxtDistributedFirewallRuleArgs.builder()
                .org("my-org")
                .vdcGroupId(g1.applyValue(getVdcGroupResult -> getVdcGroupResult.id()))
                .name("rule1")
                .build());
    
        }
    }
    
    variables:
      g1:
        fn::invoke:
          function: vcd:getVdcGroup
          arguments:
            org: my-org
            name: my-vdc-group
      r1:
        fn::invoke:
          function: vcd:getNsxtDistributedFirewallRule
          arguments:
            org: my-org
            vdcGroupId: ${g1.id}
            name: rule1
    

    Using getNsxtDistributedFirewallRule

    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 getNsxtDistributedFirewallRule(args: GetNsxtDistributedFirewallRuleArgs, opts?: InvokeOptions): Promise<GetNsxtDistributedFirewallRuleResult>
    function getNsxtDistributedFirewallRuleOutput(args: GetNsxtDistributedFirewallRuleOutputArgs, opts?: InvokeOptions): Output<GetNsxtDistributedFirewallRuleResult>
    def get_nsxt_distributed_firewall_rule(id: Optional[str] = None,
                                           name: Optional[str] = None,
                                           org: Optional[str] = None,
                                           vdc_group_id: Optional[str] = None,
                                           opts: Optional[InvokeOptions] = None) -> GetNsxtDistributedFirewallRuleResult
    def get_nsxt_distributed_firewall_rule_output(id: Optional[pulumi.Input[str]] = None,
                                           name: Optional[pulumi.Input[str]] = None,
                                           org: Optional[pulumi.Input[str]] = None,
                                           vdc_group_id: Optional[pulumi.Input[str]] = None,
                                           opts: Optional[InvokeOptions] = None) -> Output[GetNsxtDistributedFirewallRuleResult]
    func LookupNsxtDistributedFirewallRule(ctx *Context, args *LookupNsxtDistributedFirewallRuleArgs, opts ...InvokeOption) (*LookupNsxtDistributedFirewallRuleResult, error)
    func LookupNsxtDistributedFirewallRuleOutput(ctx *Context, args *LookupNsxtDistributedFirewallRuleOutputArgs, opts ...InvokeOption) LookupNsxtDistributedFirewallRuleResultOutput

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

    public static class GetNsxtDistributedFirewallRule 
    {
        public static Task<GetNsxtDistributedFirewallRuleResult> InvokeAsync(GetNsxtDistributedFirewallRuleArgs args, InvokeOptions? opts = null)
        public static Output<GetNsxtDistributedFirewallRuleResult> Invoke(GetNsxtDistributedFirewallRuleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNsxtDistributedFirewallRuleResult> getNsxtDistributedFirewallRule(GetNsxtDistributedFirewallRuleArgs args, InvokeOptions options)
    public static Output<GetNsxtDistributedFirewallRuleResult> getNsxtDistributedFirewallRule(GetNsxtDistributedFirewallRuleArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vcd:index/getNsxtDistributedFirewallRule:getNsxtDistributedFirewallRule
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of firewall rule
    VdcGroupId string
    The ID of a VDC Group
    Id string
    Org string
    The name of organization in which Distributed Firewall is located. Optional if defined at provider level.
    Name string
    The name of firewall rule
    VdcGroupId string
    The ID of a VDC Group
    Id string
    Org string
    The name of organization in which Distributed Firewall is located. Optional if defined at provider level.
    name String
    The name of firewall rule
    vdcGroupId String
    The ID of a VDC Group
    id String
    org String
    The name of organization in which Distributed Firewall is located. Optional if defined at provider level.
    name string
    The name of firewall rule
    vdcGroupId string
    The ID of a VDC Group
    id string
    org string
    The name of organization in which Distributed Firewall is located. Optional if defined at provider level.
    name str
    The name of firewall rule
    vdc_group_id str
    The ID of a VDC Group
    id str
    org str
    The name of organization in which Distributed Firewall is located. Optional if defined at provider level.
    name String
    The name of firewall rule
    vdcGroupId String
    The ID of a VDC Group
    id String
    org String
    The name of organization in which Distributed Firewall is located. Optional if defined at provider level.

    getNsxtDistributedFirewallRule Result

    The following output properties are available:

    Action string
    AppPortProfileIds List<string>
    Comment string
    Description string
    DestinationGroupsExcluded bool
    DestinationIds List<string>
    Direction string
    Enabled bool
    Id string
    IpProtocol string
    Logging bool
    Name string
    NetworkContextProfileIds List<string>
    SourceGroupsExcluded bool
    SourceIds List<string>
    VdcGroupId string
    Org string
    action String
    appPortProfileIds List<String>
    comment String
    description String
    destinationGroupsExcluded Boolean
    destinationIds List<String>
    direction String
    enabled Boolean
    id String
    ipProtocol String
    logging Boolean
    name String
    networkContextProfileIds List<String>
    sourceGroupsExcluded Boolean
    sourceIds List<String>
    vdcGroupId String
    org String
    action string
    appPortProfileIds string[]
    comment string
    description string
    destinationGroupsExcluded boolean
    destinationIds string[]
    direction string
    enabled boolean
    id string
    ipProtocol string
    logging boolean
    name string
    networkContextProfileIds string[]
    sourceGroupsExcluded boolean
    sourceIds string[]
    vdcGroupId string
    org string
    action String
    appPortProfileIds List<String>
    comment String
    description String
    destinationGroupsExcluded Boolean
    destinationIds List<String>
    direction String
    enabled Boolean
    id String
    ipProtocol String
    logging Boolean
    name String
    networkContextProfileIds List<String>
    sourceGroupsExcluded Boolean
    sourceIds List<String>
    vdcGroupId String
    org 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