This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.89.1 published on Sunday, Mar 2, 2025 by Pulumi
azure-native.network.getSecurityRule
Explore with Pulumi AI
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.89.1 published on Sunday, Mar 2, 2025 by Pulumi
Get the specified network security rule. Azure REST API version: 2023-02-01.
Other available API versions: 2019-06-01, 2022-07-01, 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01, 2024-03-01, 2024-05-01.
Using getSecurityRule
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 getSecurityRule(args: GetSecurityRuleArgs, opts?: InvokeOptions): Promise<GetSecurityRuleResult>
function getSecurityRuleOutput(args: GetSecurityRuleOutputArgs, opts?: InvokeOptions): Output<GetSecurityRuleResult>def get_security_rule(network_security_group_name: Optional[str] = None,
                      resource_group_name: Optional[str] = None,
                      security_rule_name: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetSecurityRuleResult
def get_security_rule_output(network_security_group_name: Optional[pulumi.Input[str]] = None,
                      resource_group_name: Optional[pulumi.Input[str]] = None,
                      security_rule_name: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetSecurityRuleResult]func LookupSecurityRule(ctx *Context, args *LookupSecurityRuleArgs, opts ...InvokeOption) (*LookupSecurityRuleResult, error)
func LookupSecurityRuleOutput(ctx *Context, args *LookupSecurityRuleOutputArgs, opts ...InvokeOption) LookupSecurityRuleResultOutput> Note: This function is named LookupSecurityRule in the Go SDK.
public static class GetSecurityRule 
{
    public static Task<GetSecurityRuleResult> InvokeAsync(GetSecurityRuleArgs args, InvokeOptions? opts = null)
    public static Output<GetSecurityRuleResult> Invoke(GetSecurityRuleInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSecurityRuleResult> getSecurityRule(GetSecurityRuleArgs args, InvokeOptions options)
public static Output<GetSecurityRuleResult> getSecurityRule(GetSecurityRuleArgs args, InvokeOptions options)
fn::invoke:
  function: azure-native:network:getSecurityRule
  arguments:
    # arguments dictionaryThe following arguments are supported:
- NetworkSecurity stringGroup Name 
- The name of the network security group.
- ResourceGroup stringName 
- The name of the resource group.
- SecurityRule stringName 
- The name of the security rule.
- NetworkSecurity stringGroup Name 
- The name of the network security group.
- ResourceGroup stringName 
- The name of the resource group.
- SecurityRule stringName 
- The name of the security rule.
- networkSecurity StringGroup Name 
- The name of the network security group.
- resourceGroup StringName 
- The name of the resource group.
- securityRule StringName 
- The name of the security rule.
- networkSecurity stringGroup Name 
- The name of the network security group.
- resourceGroup stringName 
- The name of the resource group.
- securityRule stringName 
- The name of the security rule.
- network_security_ strgroup_ name 
- The name of the network security group.
- resource_group_ strname 
- The name of the resource group.
- security_rule_ strname 
- The name of the security rule.
- networkSecurity StringGroup Name 
- The name of the network security group.
- resourceGroup StringName 
- The name of the resource group.
- securityRule StringName 
- The name of the security rule.
getSecurityRule Result
The following output properties are available:
- Access string
- The network traffic is allowed or denied.
- Direction string
- The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
- Etag string
- A unique read-only string that changes whenever the resource is updated.
- Priority int
- The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
- Protocol string
- Network protocol this rule applies to.
- ProvisioningState string
- The provisioning state of the security rule resource.
- Description string
- A description for this rule. Restricted to 140 chars.
- DestinationAddress stringPrefix 
- The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
- DestinationAddress List<string>Prefixes 
- The destination address prefixes. CIDR or destination IP ranges.
- DestinationApplication List<Pulumi.Security Groups Azure Native. Network. Outputs. Application Security Group Response> 
- The application security group specified as destination.
- DestinationPort stringRange 
- The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
- DestinationPort List<string>Ranges 
- The destination port ranges.
- Id string
- Resource ID.
- Name string
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- SourceAddress stringPrefix 
- The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
- SourceAddress List<string>Prefixes 
- The CIDR or source IP ranges.
- SourceApplication List<Pulumi.Security Groups Azure Native. Network. Outputs. Application Security Group Response> 
- The application security group specified as source.
- SourcePort stringRange 
- The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
- SourcePort List<string>Ranges 
- The source port ranges.
- Type string
- The type of the resource.
- Access string
- The network traffic is allowed or denied.
- Direction string
- The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
- Etag string
- A unique read-only string that changes whenever the resource is updated.
- Priority int
- The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
- Protocol string
- Network protocol this rule applies to.
- ProvisioningState string
- The provisioning state of the security rule resource.
- Description string
- A description for this rule. Restricted to 140 chars.
- DestinationAddress stringPrefix 
- The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
- DestinationAddress []stringPrefixes 
- The destination address prefixes. CIDR or destination IP ranges.
- DestinationApplication []ApplicationSecurity Groups Security Group Response 
- The application security group specified as destination.
- DestinationPort stringRange 
- The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
- DestinationPort []stringRanges 
- The destination port ranges.
- Id string
- Resource ID.
- Name string
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- SourceAddress stringPrefix 
- The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
- SourceAddress []stringPrefixes 
- The CIDR or source IP ranges.
- SourceApplication []ApplicationSecurity Groups Security Group Response 
- The application security group specified as source.
- SourcePort stringRange 
- The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
- SourcePort []stringRanges 
- The source port ranges.
- Type string
- The type of the resource.
- access String
- The network traffic is allowed or denied.
- direction String
- The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
- etag String
- A unique read-only string that changes whenever the resource is updated.
- priority Integer
- The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
- protocol String
- Network protocol this rule applies to.
- provisioningState String
- The provisioning state of the security rule resource.
- description String
- A description for this rule. Restricted to 140 chars.
- destinationAddress StringPrefix 
- The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
- destinationAddress List<String>Prefixes 
- The destination address prefixes. CIDR or destination IP ranges.
- destinationApplication List<ApplicationSecurity Groups Security Group Response> 
- The application security group specified as destination.
- destinationPort StringRange 
- The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
- destinationPort List<String>Ranges 
- The destination port ranges.
- id String
- Resource ID.
- name String
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- sourceAddress StringPrefix 
- The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
- sourceAddress List<String>Prefixes 
- The CIDR or source IP ranges.
- sourceApplication List<ApplicationSecurity Groups Security Group Response> 
- The application security group specified as source.
- sourcePort StringRange 
- The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
- sourcePort List<String>Ranges 
- The source port ranges.
- type String
- The type of the resource.
- access string
- The network traffic is allowed or denied.
- direction string
- The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
- etag string
- A unique read-only string that changes whenever the resource is updated.
- priority number
- The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
- protocol string
- Network protocol this rule applies to.
- provisioningState string
- The provisioning state of the security rule resource.
- description string
- A description for this rule. Restricted to 140 chars.
- destinationAddress stringPrefix 
- The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
- destinationAddress string[]Prefixes 
- The destination address prefixes. CIDR or destination IP ranges.
- destinationApplication ApplicationSecurity Groups Security Group Response[] 
- The application security group specified as destination.
- destinationPort stringRange 
- The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
- destinationPort string[]Ranges 
- The destination port ranges.
- id string
- Resource ID.
- name string
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- sourceAddress stringPrefix 
- The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
- sourceAddress string[]Prefixes 
- The CIDR or source IP ranges.
- sourceApplication ApplicationSecurity Groups Security Group Response[] 
- The application security group specified as source.
- sourcePort stringRange 
- The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
- sourcePort string[]Ranges 
- The source port ranges.
- type string
- The type of the resource.
- access str
- The network traffic is allowed or denied.
- direction str
- The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
- etag str
- A unique read-only string that changes whenever the resource is updated.
- priority int
- The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
- protocol str
- Network protocol this rule applies to.
- provisioning_state str
- The provisioning state of the security rule resource.
- description str
- A description for this rule. Restricted to 140 chars.
- destination_address_ strprefix 
- The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
- destination_address_ Sequence[str]prefixes 
- The destination address prefixes. CIDR or destination IP ranges.
- destination_application_ Sequence[Applicationsecurity_ groups Security Group Response] 
- The application security group specified as destination.
- destination_port_ strrange 
- The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
- destination_port_ Sequence[str]ranges 
- The destination port ranges.
- id str
- Resource ID.
- name str
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- source_address_ strprefix 
- The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
- source_address_ Sequence[str]prefixes 
- The CIDR or source IP ranges.
- source_application_ Sequence[Applicationsecurity_ groups Security Group Response] 
- The application security group specified as source.
- source_port_ strrange 
- The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
- source_port_ Sequence[str]ranges 
- The source port ranges.
- type str
- The type of the resource.
- access String
- The network traffic is allowed or denied.
- direction String
- The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
- etag String
- A unique read-only string that changes whenever the resource is updated.
- priority Number
- The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
- protocol String
- Network protocol this rule applies to.
- provisioningState String
- The provisioning state of the security rule resource.
- description String
- A description for this rule. Restricted to 140 chars.
- destinationAddress StringPrefix 
- The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
- destinationAddress List<String>Prefixes 
- The destination address prefixes. CIDR or destination IP ranges.
- destinationApplication List<Property Map>Security Groups 
- The application security group specified as destination.
- destinationPort StringRange 
- The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
- destinationPort List<String>Ranges 
- The destination port ranges.
- id String
- Resource ID.
- name String
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- sourceAddress StringPrefix 
- The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
- sourceAddress List<String>Prefixes 
- The CIDR or source IP ranges.
- sourceApplication List<Property Map>Security Groups 
- The application security group specified as source.
- sourcePort StringRange 
- The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
- sourcePort List<String>Ranges 
- The source port ranges.
- type String
- The type of the resource.
Supporting Types
ApplicationSecurityGroupResponse   
- Etag string
- A unique read-only string that changes whenever the resource is updated.
- Name string
- Resource name.
- ProvisioningState string
- The provisioning state of the application security group resource.
- ResourceGuid string
- The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
- Type string
- Resource type.
- Id string
- Resource ID.
- Location string
- Resource location.
- Dictionary<string, string>
- Resource tags.
- Etag string
- A unique read-only string that changes whenever the resource is updated.
- Name string
- Resource name.
- ProvisioningState string
- The provisioning state of the application security group resource.
- ResourceGuid string
- The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
- Type string
- Resource type.
- Id string
- Resource ID.
- Location string
- Resource location.
- map[string]string
- Resource tags.
- etag String
- A unique read-only string that changes whenever the resource is updated.
- name String
- Resource name.
- provisioningState String
- The provisioning state of the application security group resource.
- resourceGuid String
- The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
- type String
- Resource type.
- id String
- Resource ID.
- location String
- Resource location.
- Map<String,String>
- Resource tags.
- etag string
- A unique read-only string that changes whenever the resource is updated.
- name string
- Resource name.
- provisioningState string
- The provisioning state of the application security group resource.
- resourceGuid string
- The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
- type string
- Resource type.
- id string
- Resource ID.
- location string
- Resource location.
- {[key: string]: string}
- Resource tags.
- etag str
- A unique read-only string that changes whenever the resource is updated.
- name str
- Resource name.
- provisioning_state str
- The provisioning state of the application security group resource.
- resource_guid str
- The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
- type str
- Resource type.
- id str
- Resource ID.
- location str
- Resource location.
- Mapping[str, str]
- Resource tags.
- etag String
- A unique read-only string that changes whenever the resource is updated.
- name String
- Resource name.
- provisioningState String
- The provisioning state of the application security group resource.
- resourceGuid String
- The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
- type String
- Resource type.
- id String
- Resource ID.
- location String
- Resource location.
- Map<String>
- Resource tags.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.89.1 published on Sunday, Mar 2, 2025 by Pulumi