1. Packages
  2. Azure Native v2
  3. API Docs
  4. azurestackhci
  5. getSecurityRule
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

azure-native-v2.azurestackhci.getSecurityRule

Explore with Pulumi AI

These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

Gets the specified security rule. Azure REST API version: 2024-02-01-preview.

Other available API versions: 2024-05-01-preview, 2024-07-15-preview, 2024-08-01-preview.

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>
Copy
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]
Copy
func LookupSecurityRule(ctx *Context, args *LookupSecurityRuleArgs, opts ...InvokeOption) (*LookupSecurityRuleResult, error)
func LookupSecurityRuleOutput(ctx *Context, args *LookupSecurityRuleOutputArgs, opts ...InvokeOption) LookupSecurityRuleResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetSecurityRuleResult> getSecurityRule(GetSecurityRuleArgs args, InvokeOptions options)
public static Output<GetSecurityRuleResult> getSecurityRule(GetSecurityRuleArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure-native:azurestackhci:getSecurityRule
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

NetworkSecurityGroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of the network security group
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
SecurityRuleName
This property is required.
Changes to this property will trigger replacement.
string
Name of the security rule.
NetworkSecurityGroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of the network security group
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
SecurityRuleName
This property is required.
Changes to this property will trigger replacement.
string
Name of the security rule.
networkSecurityGroupName
This property is required.
Changes to this property will trigger replacement.
String
Name of the network security group
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
securityRuleName
This property is required.
Changes to this property will trigger replacement.
String
Name of the security rule.
networkSecurityGroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of the network security group
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
securityRuleName
This property is required.
Changes to this property will trigger replacement.
string
Name of the security rule.
network_security_group_name
This property is required.
Changes to this property will trigger replacement.
str
Name of the network security group
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group. The name is case insensitive.
security_rule_name
This property is required.
Changes to this property will trigger replacement.
str
Name of the security rule.
networkSecurityGroupName
This property is required.
Changes to this property will trigger replacement.
String
Name of the network security group
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
securityRuleName
This property is required.
Changes to this property will trigger replacement.
String
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.
Id string
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
Name string
The name of the resource
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
Provisioning state of the SR
SystemData Pulumi.AzureNative.AzureStackHCI.Outputs.SystemDataResponse
Azure Resource Manager metadata containing createdBy and modifiedBy information.
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Description string
A description for this rule. Restricted to 140 chars.
DestinationAddressPrefixes List<string>
The destination address prefixes. CIDR or destination IP ranges.
DestinationPortRanges List<string>
The destination port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
ExtendedLocation Pulumi.AzureNative.AzureStackHCI.Outputs.ExtendedLocationResponse
The extendedLocation of the resource.
SourceAddressPrefixes List<string>
The CIDR or source IP ranges.
SourcePortRanges List<string>
The source port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
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.
Id string
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
Name string
The name of the resource
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
Provisioning state of the SR
SystemData SystemDataResponse
Azure Resource Manager metadata containing createdBy and modifiedBy information.
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Description string
A description for this rule. Restricted to 140 chars.
DestinationAddressPrefixes []string
The destination address prefixes. CIDR or destination IP ranges.
DestinationPortRanges []string
The destination port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
ExtendedLocation ExtendedLocationResponse
The extendedLocation of the resource.
SourceAddressPrefixes []string
The CIDR or source IP ranges.
SourcePortRanges []string
The source port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
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.
id String
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
name String
The name of the resource
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
Provisioning state of the SR
systemData SystemDataResponse
Azure Resource Manager metadata containing createdBy and modifiedBy information.
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
description String
A description for this rule. Restricted to 140 chars.
destinationAddressPrefixes List<String>
The destination address prefixes. CIDR or destination IP ranges.
destinationPortRanges List<String>
The destination port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
extendedLocation ExtendedLocationResponse
The extendedLocation of the resource.
sourceAddressPrefixes List<String>
The CIDR or source IP ranges.
sourcePortRanges List<String>
The source port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
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.
id string
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
name string
The name of the resource
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
Provisioning state of the SR
systemData SystemDataResponse
Azure Resource Manager metadata containing createdBy and modifiedBy information.
type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
description string
A description for this rule. Restricted to 140 chars.
destinationAddressPrefixes string[]
The destination address prefixes. CIDR or destination IP ranges.
destinationPortRanges string[]
The destination port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
extendedLocation ExtendedLocationResponse
The extendedLocation of the resource.
sourceAddressPrefixes string[]
The CIDR or source IP ranges.
sourcePortRanges string[]
The source port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
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.
id str
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
name str
The name of the resource
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
Provisioning state of the SR
system_data SystemDataResponse
Azure Resource Manager metadata containing createdBy and modifiedBy information.
type str
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
description str
A description for this rule. Restricted to 140 chars.
destination_address_prefixes Sequence[str]
The destination address prefixes. CIDR or destination IP ranges.
destination_port_ranges Sequence[str]
The destination port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
extended_location ExtendedLocationResponse
The extendedLocation of the resource.
source_address_prefixes Sequence[str]
The CIDR or source IP ranges.
source_port_ranges Sequence[str]
The source port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
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.
id String
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
name String
The name of the resource
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
Provisioning state of the SR
systemData Property Map
Azure Resource Manager metadata containing createdBy and modifiedBy information.
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
description String
A description for this rule. Restricted to 140 chars.
destinationAddressPrefixes List<String>
The destination address prefixes. CIDR or destination IP ranges.
destinationPortRanges List<String>
The destination port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
extendedLocation Property Map
The extendedLocation of the resource.
sourceAddressPrefixes List<String>
The CIDR or source IP ranges.
sourcePortRanges List<String>
The source port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.

Supporting Types

ExtendedLocationResponse

Name string
The name of the extended location.
Type string
The type of the extended location.
Name string
The name of the extended location.
Type string
The type of the extended location.
name String
The name of the extended location.
type String
The type of the extended location.
name string
The name of the extended location.
type string
The type of the extended location.
name str
The name of the extended location.
type str
The type of the extended location.
name String
The name of the extended location.
type String
The type of the extended location.

SystemDataResponse

CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
The type of identity that created the resource.
LastModifiedAt string
The timestamp of resource last modification (UTC)
LastModifiedBy string
The identity that last modified the resource.
LastModifiedByType string
The type of identity that last modified the resource.
CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
The type of identity that created the resource.
LastModifiedAt string
The timestamp of resource last modification (UTC)
LastModifiedBy string
The identity that last modified the resource.
LastModifiedByType string
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
The type of identity that created the resource.
lastModifiedAt String
The timestamp of resource last modification (UTC)
lastModifiedBy String
The identity that last modified the resource.
lastModifiedByType String
The type of identity that last modified the resource.
createdAt string
The timestamp of resource creation (UTC).
createdBy string
The identity that created the resource.
createdByType string
The type of identity that created the resource.
lastModifiedAt string
The timestamp of resource last modification (UTC)
lastModifiedBy string
The identity that last modified the resource.
lastModifiedByType string
The type of identity that last modified the resource.
created_at str
The timestamp of resource creation (UTC).
created_by str
The identity that created the resource.
created_by_type str
The type of identity that created the resource.
last_modified_at str
The timestamp of resource last modification (UTC)
last_modified_by str
The identity that last modified the resource.
last_modified_by_type str
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
The type of identity that created the resource.
lastModifiedAt String
The timestamp of resource last modification (UTC)
lastModifiedBy String
The identity that last modified the resource.
lastModifiedByType String
The type of identity that last modified the resource.

Package Details

Repository
azure-native-v2 pulumi/pulumi-azure-native
License
Apache-2.0
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi