-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_nic.iql
More file actions
35 lines (32 loc) · 1.11 KB
/
example_nic.iql
File metadata and controls
35 lines (32 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*+ createorupdate */
INSERT INTO azure.network.interfaces(
networkInterfaceName,
resourceGroupName,
subscriptionId,
data__location,
data__properties,
data__tags
)
SELECT
'{{ nic_name }}',
'{{ resource_group_name }}',
'{{ subscription_id }}',
'{{ location }}',
'{"ipConfigurations": [ {{ nic_ip_config }} ], "networkSecurityGroup": { "id": "{{ network_security_group_id }}"}}',
'{{ global_tags }}';
/*+ statecheck, retries=5, retry_delay=5 */
SELECT COUNT(*) as count FROM azure.network.interfaces
WHERE subscriptionId = '{{ subscription_id }}'
AND resourceGroupName = '{{ resource_group_name }}'
AND networkInterfaceName = '{{ nic_name }}';
/*+ exports */
SELECT id as network_interface_id
FROM azure.network.interfaces
WHERE subscriptionId = '{{ subscription_id }}'
AND resourceGroupName = '{{ resource_group_name }}'
AND networkInterfaceName = '{{ nic_name }}';
/*+ delete */
DELETE FROM azure.network.interfaces
WHERE subscriptionId = '{{ subscription_id }}'
AND resourceGroupName = '{{ resource_group_name }}'
AND networkInterfaceName = '{{ nic_name }}';