1. Packages
  2. Packages
  3. Nsxt Provider
  4. API Docs
  5. getPolicyIntrusionServiceGatewayPolicyRule
Viewing docs for nsxt 3.12.0
published on Monday, May 18, 2026 by vmware
Viewing docs for nsxt 3.12.0
published on Monday, May 18, 2026 by vmware

    This data source provides information about an existing Intrusion Service Gateway Policy Rule configured on NSX. It can be useful to retrieve individual IDPS Gateway rules that are managed separately from their parent policy.

    NOTE: This data source retrieves standalone rules that are managed separately from their parent policy, allowing you to refer specific IDPS Gateway rule in other resources. For different use cases, consider:

    • nsxt.PolicyIntrusionServiceGatewayPolicy - For IDPS Gateway policy with embedded rules
    • nsxt.PolicyParentIntrusionServiceGatewayPolicy - For parent IDPS Gateway policy metadata only

    This data source is applicable to NSX Policy Manager (NSX version 4.2.0 onwards).

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nsxt from "@pulumi/nsxt";
    
    // Get parent Gateway policy for its path
    const idsGwPolicy = nsxt.getPolicyParentIntrusionServiceGatewayPolicy({
        displayName: "my-ids-gateway-policy",
    });
    // Get individual Gateway rule from that policy
    const idsGwRule = idsGwPolicy.then(idsGwPolicy => nsxt.getPolicyIntrusionServiceGatewayPolicyRule({
        displayName: "detect-north-south-threats",
        policyPath: idsGwPolicy.path,
    }));
    
    import pulumi
    import pulumi_nsxt as nsxt
    
    # Get parent Gateway policy for its path
    ids_gw_policy = nsxt.get_policy_parent_intrusion_service_gateway_policy(display_name="my-ids-gateway-policy")
    # Get individual Gateway rule from that policy
    ids_gw_rule = nsxt.get_policy_intrusion_service_gateway_policy_rule(display_name="detect-north-south-threats",
        policy_path=ids_gw_policy.path)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/nsxt/v3/nsxt"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Get parent Gateway policy for its path
    		idsGwPolicy, err := nsxt.LookupPolicyParentIntrusionServiceGatewayPolicy(ctx, &nsxt.LookupPolicyParentIntrusionServiceGatewayPolicyArgs{
    			DisplayName: pulumi.StringRef("my-ids-gateway-policy"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Get individual Gateway rule from that policy
    		_, err = nsxt.LookupPolicyIntrusionServiceGatewayPolicyRule(ctx, &nsxt.LookupPolicyIntrusionServiceGatewayPolicyRuleArgs{
    			DisplayName: pulumi.StringRef("detect-north-south-threats"),
    			PolicyPath:  idsGwPolicy.Path,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nsxt = Pulumi.Nsxt;
    
    return await Deployment.RunAsync(() => 
    {
        // Get parent Gateway policy for its path
        var idsGwPolicy = Nsxt.GetPolicyParentIntrusionServiceGatewayPolicy.Invoke(new()
        {
            DisplayName = "my-ids-gateway-policy",
        });
    
        // Get individual Gateway rule from that policy
        var idsGwRule = Nsxt.GetPolicyIntrusionServiceGatewayPolicyRule.Invoke(new()
        {
            DisplayName = "detect-north-south-threats",
            PolicyPath = idsGwPolicy.Apply(getPolicyParentIntrusionServiceGatewayPolicyResult => getPolicyParentIntrusionServiceGatewayPolicyResult.Path),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nsxt.NsxtFunctions;
    import com.pulumi.nsxt.inputs.GetPolicyParentIntrusionServiceGatewayPolicyArgs;
    import com.pulumi.nsxt.inputs.GetPolicyIntrusionServiceGatewayPolicyRuleArgs;
    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) {
            // Get parent Gateway policy for its path
            final var idsGwPolicy = NsxtFunctions.getPolicyParentIntrusionServiceGatewayPolicy(GetPolicyParentIntrusionServiceGatewayPolicyArgs.builder()
                .displayName("my-ids-gateway-policy")
                .build());
    
            // Get individual Gateway rule from that policy
            final var idsGwRule = NsxtFunctions.getPolicyIntrusionServiceGatewayPolicyRule(GetPolicyIntrusionServiceGatewayPolicyRuleArgs.builder()
                .displayName("detect-north-south-threats")
                .policyPath(idsGwPolicy.path())
                .build());
    
        }
    }
    
    variables:
      # Get parent Gateway policy for its path
      idsGwPolicy:
        fn::invoke:
          function: nsxt:getPolicyParentIntrusionServiceGatewayPolicy
          arguments:
            displayName: my-ids-gateway-policy
      # Get individual Gateway rule from that policy
      idsGwRule:
        fn::invoke:
          function: nsxt:getPolicyIntrusionServiceGatewayPolicyRule
          arguments:
            displayName: detect-north-south-threats
            policyPath: ${idsGwPolicy.path}
    
    Example coming soon!
    

    Using getPolicyIntrusionServiceGatewayPolicyRule

    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 getPolicyIntrusionServiceGatewayPolicyRule(args: GetPolicyIntrusionServiceGatewayPolicyRuleArgs, opts?: InvokeOptions): Promise<GetPolicyIntrusionServiceGatewayPolicyRuleResult>
    function getPolicyIntrusionServiceGatewayPolicyRuleOutput(args: GetPolicyIntrusionServiceGatewayPolicyRuleOutputArgs, opts?: InvokeOptions): Output<GetPolicyIntrusionServiceGatewayPolicyRuleResult>
    def get_policy_intrusion_service_gateway_policy_rule(description: Optional[str] = None,
                                                         direction: Optional[str] = None,
                                                         display_name: Optional[str] = None,
                                                         domain: Optional[str] = None,
                                                         id: Optional[str] = None,
                                                         ip_version: Optional[str] = None,
                                                         policy_path: Optional[str] = None,
                                                         tags: Optional[Sequence[GetPolicyIntrusionServiceGatewayPolicyRuleTag]] = None,
                                                         opts: Optional[InvokeOptions] = None) -> GetPolicyIntrusionServiceGatewayPolicyRuleResult
    def get_policy_intrusion_service_gateway_policy_rule_output(description: pulumi.Input[Optional[str]] = None,
                                                         direction: pulumi.Input[Optional[str]] = None,
                                                         display_name: pulumi.Input[Optional[str]] = None,
                                                         domain: pulumi.Input[Optional[str]] = None,
                                                         id: pulumi.Input[Optional[str]] = None,
                                                         ip_version: pulumi.Input[Optional[str]] = None,
                                                         policy_path: pulumi.Input[Optional[str]] = None,
                                                         tags: pulumi.Input[Optional[Sequence[pulumi.Input[GetPolicyIntrusionServiceGatewayPolicyRuleTagArgs]]]] = None,
                                                         opts: Optional[InvokeOptions] = None) -> Output[GetPolicyIntrusionServiceGatewayPolicyRuleResult]
    func LookupPolicyIntrusionServiceGatewayPolicyRule(ctx *Context, args *LookupPolicyIntrusionServiceGatewayPolicyRuleArgs, opts ...InvokeOption) (*LookupPolicyIntrusionServiceGatewayPolicyRuleResult, error)
    func LookupPolicyIntrusionServiceGatewayPolicyRuleOutput(ctx *Context, args *LookupPolicyIntrusionServiceGatewayPolicyRuleOutputArgs, opts ...InvokeOption) LookupPolicyIntrusionServiceGatewayPolicyRuleResultOutput

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

    public static class GetPolicyIntrusionServiceGatewayPolicyRule 
    {
        public static Task<GetPolicyIntrusionServiceGatewayPolicyRuleResult> InvokeAsync(GetPolicyIntrusionServiceGatewayPolicyRuleArgs args, InvokeOptions? opts = null)
        public static Output<GetPolicyIntrusionServiceGatewayPolicyRuleResult> Invoke(GetPolicyIntrusionServiceGatewayPolicyRuleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPolicyIntrusionServiceGatewayPolicyRuleResult> getPolicyIntrusionServiceGatewayPolicyRule(GetPolicyIntrusionServiceGatewayPolicyRuleArgs args, InvokeOptions options)
    public static Output<GetPolicyIntrusionServiceGatewayPolicyRuleResult> getPolicyIntrusionServiceGatewayPolicyRule(GetPolicyIntrusionServiceGatewayPolicyRuleArgs args, InvokeOptions options)
    
    fn::invoke:
      function: nsxt:index/getPolicyIntrusionServiceGatewayPolicyRule:getPolicyIntrusionServiceGatewayPolicyRule
      arguments:
        # arguments dictionary
    data "nsxt_getpolicyintrusionservicegatewaypolicyrule" "name" {
        # arguments
    }

    The following arguments are supported:

    PolicyPath string
    The path of the parent gateway policy containing this rule.
    Description string
    The description of the resource.
    Direction string
    Traffic direction.
    DisplayName string
    The display name of the rule to retrieve.
    Domain string
    The domain of the policy containing this rule. Defaults to default.
    Id string
    The ID of the rule to retrieve.
    IpVersion string
    IP version.
    Tags List<GetPolicyIntrusionServiceGatewayPolicyRuleTag>
    A list of scope + tag pairs to associate with this rule.
    PolicyPath string
    The path of the parent gateway policy containing this rule.
    Description string
    The description of the resource.
    Direction string
    Traffic direction.
    DisplayName string
    The display name of the rule to retrieve.
    Domain string
    The domain of the policy containing this rule. Defaults to default.
    Id string
    The ID of the rule to retrieve.
    IpVersion string
    IP version.
    Tags []GetPolicyIntrusionServiceGatewayPolicyRuleTag
    A list of scope + tag pairs to associate with this rule.
    policy_path string
    The path of the parent gateway policy containing this rule.
    description string
    The description of the resource.
    direction string
    Traffic direction.
    display_name string
    The display name of the rule to retrieve.
    domain string
    The domain of the policy containing this rule. Defaults to default.
    id string
    The ID of the rule to retrieve.
    ip_version string
    IP version.
    tags list(object)
    A list of scope + tag pairs to associate with this rule.
    policyPath String
    The path of the parent gateway policy containing this rule.
    description String
    The description of the resource.
    direction String
    Traffic direction.
    displayName String
    The display name of the rule to retrieve.
    domain String
    The domain of the policy containing this rule. Defaults to default.
    id String
    The ID of the rule to retrieve.
    ipVersion String
    IP version.
    tags List<GetPolicyIntrusionServiceGatewayPolicyRuleTag>
    A list of scope + tag pairs to associate with this rule.
    policyPath string
    The path of the parent gateway policy containing this rule.
    description string
    The description of the resource.
    direction string
    Traffic direction.
    displayName string
    The display name of the rule to retrieve.
    domain string
    The domain of the policy containing this rule. Defaults to default.
    id string
    The ID of the rule to retrieve.
    ipVersion string
    IP version.
    tags GetPolicyIntrusionServiceGatewayPolicyRuleTag[]
    A list of scope + tag pairs to associate with this rule.
    policy_path str
    The path of the parent gateway policy containing this rule.
    description str
    The description of the resource.
    direction str
    Traffic direction.
    display_name str
    The display name of the rule to retrieve.
    domain str
    The domain of the policy containing this rule. Defaults to default.
    id str
    The ID of the rule to retrieve.
    ip_version str
    IP version.
    tags Sequence[GetPolicyIntrusionServiceGatewayPolicyRuleTag]
    A list of scope + tag pairs to associate with this rule.
    policyPath String
    The path of the parent gateway policy containing this rule.
    description String
    The description of the resource.
    direction String
    Traffic direction.
    displayName String
    The display name of the rule to retrieve.
    domain String
    The domain of the policy containing this rule. Defaults to default.
    id String
    The ID of the rule to retrieve.
    ipVersion String
    IP version.
    tags List<Property Map>
    A list of scope + tag pairs to associate with this rule.

    getPolicyIntrusionServiceGatewayPolicyRule Result

    The following output properties are available:

    Action string
    Action for this rule.
    Description string
    The description of the resource.
    DestinationGroups List<string>
    List of destination groups.
    DestinationsExcluded bool
    Flag to indicate whether destinations are negated.
    Direction string
    Traffic direction.
    Disabled bool
    Flag to disable the rule.
    DisplayName string
    Id string
    IdsProfiles List<string>
    List of IDS profiles for this rule.
    IpVersion string
    IP version.
    LogLabel string
    Additional information which will be propagated to the rule syslog.
    Logged bool
    Flag to enable logging.
    Notes string
    Text for additional notes on changes for the rule.
    Path string
    The NSX path of the rule resource.
    PolicyPath string
    Revision double
    Indicates current revision number of the object as seen by NSX-T API server.
    RuleId double
    Unique positive number that is assigned by the system and is useful for debugging.
    Scopes List<string>
    List of policy objects where the rule is enforced.
    SequenceNumber double
    The sequence number of the rule.
    Services List<string>
    List of services.
    SourceGroups List<string>
    List of source groups.
    SourcesExcluded bool
    Flag to indicate whether sources are negated.
    Domain string
    Tags List<GetPolicyIntrusionServiceGatewayPolicyRuleTag>
    A list of scope + tag pairs to associate with this rule.
    Action string
    Action for this rule.
    Description string
    The description of the resource.
    DestinationGroups []string
    List of destination groups.
    DestinationsExcluded bool
    Flag to indicate whether destinations are negated.
    Direction string
    Traffic direction.
    Disabled bool
    Flag to disable the rule.
    DisplayName string
    Id string
    IdsProfiles []string
    List of IDS profiles for this rule.
    IpVersion string
    IP version.
    LogLabel string
    Additional information which will be propagated to the rule syslog.
    Logged bool
    Flag to enable logging.
    Notes string
    Text for additional notes on changes for the rule.
    Path string
    The NSX path of the rule resource.
    PolicyPath string
    Revision float64
    Indicates current revision number of the object as seen by NSX-T API server.
    RuleId float64
    Unique positive number that is assigned by the system and is useful for debugging.
    Scopes []string
    List of policy objects where the rule is enforced.
    SequenceNumber float64
    The sequence number of the rule.
    Services []string
    List of services.
    SourceGroups []string
    List of source groups.
    SourcesExcluded bool
    Flag to indicate whether sources are negated.
    Domain string
    Tags []GetPolicyIntrusionServiceGatewayPolicyRuleTag
    A list of scope + tag pairs to associate with this rule.
    action string
    Action for this rule.
    description string
    The description of the resource.
    destination_groups list(string)
    List of destination groups.
    destinations_excluded bool
    Flag to indicate whether destinations are negated.
    direction string
    Traffic direction.
    disabled bool
    Flag to disable the rule.
    display_name string
    id string
    ids_profiles list(string)
    List of IDS profiles for this rule.
    ip_version string
    IP version.
    log_label string
    Additional information which will be propagated to the rule syslog.
    logged bool
    Flag to enable logging.
    notes string
    Text for additional notes on changes for the rule.
    path string
    The NSX path of the rule resource.
    policy_path string
    revision number
    Indicates current revision number of the object as seen by NSX-T API server.
    rule_id number
    Unique positive number that is assigned by the system and is useful for debugging.
    scopes list(string)
    List of policy objects where the rule is enforced.
    sequence_number number
    The sequence number of the rule.
    services list(string)
    List of services.
    source_groups list(string)
    List of source groups.
    sources_excluded bool
    Flag to indicate whether sources are negated.
    domain string
    tags list(object)
    A list of scope + tag pairs to associate with this rule.
    action String
    Action for this rule.
    description String
    The description of the resource.
    destinationGroups List<String>
    List of destination groups.
    destinationsExcluded Boolean
    Flag to indicate whether destinations are negated.
    direction String
    Traffic direction.
    disabled Boolean
    Flag to disable the rule.
    displayName String
    id String
    idsProfiles List<String>
    List of IDS profiles for this rule.
    ipVersion String
    IP version.
    logLabel String
    Additional information which will be propagated to the rule syslog.
    logged Boolean
    Flag to enable logging.
    notes String
    Text for additional notes on changes for the rule.
    path String
    The NSX path of the rule resource.
    policyPath String
    revision Double
    Indicates current revision number of the object as seen by NSX-T API server.
    ruleId Double
    Unique positive number that is assigned by the system and is useful for debugging.
    scopes List<String>
    List of policy objects where the rule is enforced.
    sequenceNumber Double
    The sequence number of the rule.
    services List<String>
    List of services.
    sourceGroups List<String>
    List of source groups.
    sourcesExcluded Boolean
    Flag to indicate whether sources are negated.
    domain String
    tags List<GetPolicyIntrusionServiceGatewayPolicyRuleTag>
    A list of scope + tag pairs to associate with this rule.
    action string
    Action for this rule.
    description string
    The description of the resource.
    destinationGroups string[]
    List of destination groups.
    destinationsExcluded boolean
    Flag to indicate whether destinations are negated.
    direction string
    Traffic direction.
    disabled boolean
    Flag to disable the rule.
    displayName string
    id string
    idsProfiles string[]
    List of IDS profiles for this rule.
    ipVersion string
    IP version.
    logLabel string
    Additional information which will be propagated to the rule syslog.
    logged boolean
    Flag to enable logging.
    notes string
    Text for additional notes on changes for the rule.
    path string
    The NSX path of the rule resource.
    policyPath string
    revision number
    Indicates current revision number of the object as seen by NSX-T API server.
    ruleId number
    Unique positive number that is assigned by the system and is useful for debugging.
    scopes string[]
    List of policy objects where the rule is enforced.
    sequenceNumber number
    The sequence number of the rule.
    services string[]
    List of services.
    sourceGroups string[]
    List of source groups.
    sourcesExcluded boolean
    Flag to indicate whether sources are negated.
    domain string
    tags GetPolicyIntrusionServiceGatewayPolicyRuleTag[]
    A list of scope + tag pairs to associate with this rule.
    action str
    Action for this rule.
    description str
    The description of the resource.
    destination_groups Sequence[str]
    List of destination groups.
    destinations_excluded bool
    Flag to indicate whether destinations are negated.
    direction str
    Traffic direction.
    disabled bool
    Flag to disable the rule.
    display_name str
    id str
    ids_profiles Sequence[str]
    List of IDS profiles for this rule.
    ip_version str
    IP version.
    log_label str
    Additional information which will be propagated to the rule syslog.
    logged bool
    Flag to enable logging.
    notes str
    Text for additional notes on changes for the rule.
    path str
    The NSX path of the rule resource.
    policy_path str
    revision float
    Indicates current revision number of the object as seen by NSX-T API server.
    rule_id float
    Unique positive number that is assigned by the system and is useful for debugging.
    scopes Sequence[str]
    List of policy objects where the rule is enforced.
    sequence_number float
    The sequence number of the rule.
    services Sequence[str]
    List of services.
    source_groups Sequence[str]
    List of source groups.
    sources_excluded bool
    Flag to indicate whether sources are negated.
    domain str
    tags Sequence[GetPolicyIntrusionServiceGatewayPolicyRuleTag]
    A list of scope + tag pairs to associate with this rule.
    action String
    Action for this rule.
    description String
    The description of the resource.
    destinationGroups List<String>
    List of destination groups.
    destinationsExcluded Boolean
    Flag to indicate whether destinations are negated.
    direction String
    Traffic direction.
    disabled Boolean
    Flag to disable the rule.
    displayName String
    id String
    idsProfiles List<String>
    List of IDS profiles for this rule.
    ipVersion String
    IP version.
    logLabel String
    Additional information which will be propagated to the rule syslog.
    logged Boolean
    Flag to enable logging.
    notes String
    Text for additional notes on changes for the rule.
    path String
    The NSX path of the rule resource.
    policyPath String
    revision Number
    Indicates current revision number of the object as seen by NSX-T API server.
    ruleId Number
    Unique positive number that is assigned by the system and is useful for debugging.
    scopes List<String>
    List of policy objects where the rule is enforced.
    sequenceNumber Number
    The sequence number of the rule.
    services List<String>
    List of services.
    sourceGroups List<String>
    List of source groups.
    sourcesExcluded Boolean
    Flag to indicate whether sources are negated.
    domain String
    tags List<Property Map>
    A list of scope + tag pairs to associate with this rule.

    Supporting Types

    GetPolicyIntrusionServiceGatewayPolicyRuleTag

    Scope string
    List of policy objects where the rule is enforced.
    Tag string
    A list of scope + tag pairs to associate with this rule.
    Scope string
    List of policy objects where the rule is enforced.
    Tag string
    A list of scope + tag pairs to associate with this rule.
    scope string
    List of policy objects where the rule is enforced.
    tag string
    A list of scope + tag pairs to associate with this rule.
    scope String
    List of policy objects where the rule is enforced.
    tag String
    A list of scope + tag pairs to associate with this rule.
    scope string
    List of policy objects where the rule is enforced.
    tag string
    A list of scope + tag pairs to associate with this rule.
    scope str
    List of policy objects where the rule is enforced.
    tag str
    A list of scope + tag pairs to associate with this rule.
    scope String
    List of policy objects where the rule is enforced.
    tag String
    A list of scope + tag pairs to associate with this rule.

    Package Details

    Repository
    nsxt vmware/terraform-provider-nsxt
    License
    Notes
    This Pulumi package is based on the nsxt Terraform Provider.
    Viewing docs for nsxt 3.12.0
    published on Monday, May 18, 2026 by vmware

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial