security_rules
Creates, updates, deletes, gets or lists a security_rules resource.
Overview
| Name | security_rules |
| Type | Resource |
| Id | azure_stack.azure_stack_hci_vm.security_rules |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_network_security_group
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
access | string | The network traffic is allowed or denied. Required. Known values are: "Allow" and "Deny". (Allow, Deny) |
description | string | A description for this rule. Restricted to 140 chars. |
destinationAddressPrefixes | array | The destination address prefixes. CIDR or destination IP ranges. |
destinationPortRanges | array | The destination port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. |
direction | string | The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Required. Known values are: "Inbound" and "Outbound". (Inbound, Outbound) |
extendedLocation | object | The extendedLocation 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. Required. |
protocol | string | Network protocol this rule applies to. Required. Known values are: "Tcp", "Udp", "Icmp", and "*". (Tcp, Udp, Icmp, *) |
provisioningState | string | Provisioning state of the SR. Known values are: "Succeeded", "Failed", "InProgress", "Accepted", "Deleting", and "Canceled". (Succeeded, Failed, InProgress, Accepted, Deleting, Canceled) |
sourceAddressPrefixes | array | The CIDR or source IP ranges. |
sourcePortRanges | array | The source port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. |
systemData | object | 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". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
access | string | The network traffic is allowed or denied. Required. Known values are: "Allow" and "Deny". (Allow, Deny) |
description | string | A description for this rule. Restricted to 140 chars. |
destinationAddressPrefixes | array | The destination address prefixes. CIDR or destination IP ranges. |
destinationPortRanges | array | The destination port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. |
direction | string | The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Required. Known values are: "Inbound" and "Outbound". (Inbound, Outbound) |
extendedLocation | object | The extendedLocation 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. Required. |
protocol | string | Network protocol this rule applies to. Required. Known values are: "Tcp", "Udp", "Icmp", and "*". (Tcp, Udp, Icmp, *) |
provisioningState | string | Provisioning state of the SR. Known values are: "Succeeded", "Failed", "InProgress", "Accepted", "Deleting", and "Canceled". (Succeeded, Failed, InProgress, Accepted, Deleting, Canceled) |
sourceAddressPrefixes | array | The CIDR or source IP ranges. |
sourcePortRanges | array | The source port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. |
systemData | object | 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". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, network_security_group_name, security_rule_name, subscription_id | Gets the specified security rule. | |
list_by_network_security_group | select | resource_group_name, network_security_group_name, subscription_id | Gets all security rules in a Network Security Group. | |
create_or_update | insert | resource_group_name, network_security_group_name, security_rule_name, subscription_id | Creates or updates a security rule in the specified resource group. | |
create_or_update | replace | resource_group_name, network_security_group_name, security_rule_name, subscription_id | Creates or updates a security rule in the specified resource group. | |
delete | delete | resource_group_name, network_security_group_name, security_rule_name, subscription_id | Deletes the specified security rule. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
network_security_group_name | string | Name of the network security group. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
security_rule_name | string | Name of the security rule. Required. |
subscription_id | string |
SELECT examples
- get
- list_by_network_security_group
Gets the specified security rule.
SELECT
id,
name,
access,
description,
destinationAddressPrefixes,
destinationPortRanges,
direction,
extendedLocation,
priority,
protocol,
provisioningState,
sourceAddressPrefixes,
sourcePortRanges,
systemData,
type
FROM azure_stack.azure_stack_hci_vm.security_rules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND network_security_group_name = '{{ network_security_group_name }}' -- required
AND security_rule_name = '{{ security_rule_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets all security rules in a Network Security Group.
SELECT
id,
name,
access,
description,
destinationAddressPrefixes,
destinationPortRanges,
direction,
extendedLocation,
priority,
protocol,
provisioningState,
sourceAddressPrefixes,
sourcePortRanges,
systemData,
type
FROM azure_stack.azure_stack_hci_vm.security_rules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND network_security_group_name = '{{ network_security_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Creates or updates a security rule in the specified resource group.
INSERT INTO azure_stack.azure_stack_hci_vm.security_rules (
properties,
extendedLocation,
resource_group_name,
network_security_group_name,
security_rule_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ extendedLocation }}',
'{{ resource_group_name }}',
'{{ network_security_group_name }}',
'{{ security_rule_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
extendedLocation,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: security_rules
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the security_rules resource.
- name: network_security_group_name
value: "{{ network_security_group_name }}"
description: Required parameter for the security_rules resource.
- name: security_rule_name
value: "{{ security_rule_name }}"
description: Required parameter for the security_rules resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the security_rules resource.
- name: properties
description: |
The resource-specific properties for this resource.
value:
description: "{{ description }}"
protocol: "{{ protocol }}"
sourceAddressPrefixes:
- "{{ sourceAddressPrefixes }}"
destinationAddressPrefixes:
- "{{ destinationAddressPrefixes }}"
sourcePortRanges:
- "{{ sourcePortRanges }}"
destinationPortRanges:
- "{{ destinationPortRanges }}"
access: "{{ access }}"
priority: {{ priority }}
direction: "{{ direction }}"
provisioningState: "{{ provisioningState }}"
- name: extendedLocation
description: |
The extendedLocation of the resource.
value:
name: "{{ name }}"
type: "{{ type }}"
REPLACE examples
- create_or_update
Creates or updates a security rule in the specified resource group.
REPLACE azure_stack.azure_stack_hci_vm.security_rules
SET
properties = '{{ properties }}',
extendedLocation = '{{ extendedLocation }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND network_security_group_name = '{{ network_security_group_name }}' --required
AND security_rule_name = '{{ security_rule_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
extendedLocation,
properties,
systemData,
type;
DELETE examples
- delete
Deletes the specified security rule.
DELETE FROM azure_stack.azure_stack_hci_vm.security_rules
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND network_security_group_name = '{{ network_security_group_name }}' --required
AND security_rule_name = '{{ security_rule_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;