vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware
vcd.getNsxtDistributedFirewallRule
Explore with Pulumi AI
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
- Vdc
Group stringId - 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
- Vdc
Group stringId - 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
- vdc
Group StringId - 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
- vdc
Group stringId - 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_ strid - 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
- vdc
Group StringId - 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
- App
Port List<string>Profile Ids - Comment string
- Description string
- Destination
Groups boolExcluded - Destination
Ids List<string> - Direction string
- Enabled bool
- Id string
- Ip
Protocol string - Logging bool
- Name string
- Network
Context List<string>Profile Ids - Source
Groups boolExcluded - Source
Ids List<string> - Vdc
Group stringId - Org string
- Action string
- App
Port []stringProfile Ids - Comment string
- Description string
- Destination
Groups boolExcluded - Destination
Ids []string - Direction string
- Enabled bool
- Id string
- Ip
Protocol string - Logging bool
- Name string
- Network
Context []stringProfile Ids - Source
Groups boolExcluded - Source
Ids []string - Vdc
Group stringId - Org string
- action String
- app
Port List<String>Profile Ids - comment String
- description String
- destination
Groups BooleanExcluded - destination
Ids List<String> - direction String
- enabled Boolean
- id String
- ip
Protocol String - logging Boolean
- name String
- network
Context List<String>Profile Ids - source
Groups BooleanExcluded - source
Ids List<String> - vdc
Group StringId - org String
- action string
- app
Port string[]Profile Ids - comment string
- description string
- destination
Groups booleanExcluded - destination
Ids string[] - direction string
- enabled boolean
- id string
- ip
Protocol string - logging boolean
- name string
- network
Context string[]Profile Ids - source
Groups booleanExcluded - source
Ids string[] - vdc
Group stringId - org string
- action str
- app_
port_ Sequence[str]profile_ ids - comment str
- description str
- destination_
groups_ boolexcluded - destination_
ids Sequence[str] - direction str
- enabled bool
- id str
- ip_
protocol str - logging bool
- name str
- network_
context_ Sequence[str]profile_ ids - source_
groups_ boolexcluded - source_
ids Sequence[str] - vdc_
group_ strid - org str
- action String
- app
Port List<String>Profile Ids - comment String
- description String
- destination
Groups BooleanExcluded - destination
Ids List<String> - direction String
- enabled Boolean
- id String
- ip
Protocol String - logging Boolean
- name String
- network
Context List<String>Profile Ids - source
Groups BooleanExcluded - source
Ids List<String> - vdc
Group StringId - org String
Package Details
- Repository
- vcd vmware/terraform-provider-vcd
- License
- Notes
- This Pulumi package is based on the
vcd
Terraform Provider.