-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
20f013a
commit 986f095
Showing
15 changed files
with
429 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
resource "null_resource" "named_resource" { | ||
provisioner "local-exec" { | ||
command = "az iot dps delete --resource-group {{ output.resource_name.value }} --name {{ output.resource_name.value }}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"id": "{{ output.resource_id.value }}", | ||
"name": "{{ resourceName }}", | ||
"region": "{{ output.location.value }}", | ||
"resource_group": "{{ resourceName }}", | ||
"subscription_id": "{{ output.subscription_id.value }}", | ||
"type": "Microsoft.Devices/provisioningServices" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select name, id, type, region, resource_group, subscription_id | ||
from azure.azure_iothub_dps | ||
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ | ||
{ | ||
"id": "{{ output.resource_id.value }}", | ||
"name": "{{ resourceName }}", | ||
"type": "Microsoft.Devices/provisioningServices" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select name, id, type | ||
from azure.azure_iothub_dps | ||
where name = '{{ resourceName }}'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select name, tags, title, akas | ||
from azure.azure_iothub_dps | ||
where name = 'dummy-{{ resourceName }}' and resource_group = '{{ resourceName }}'; |
10 changes: 10 additions & 0 deletions
10
azure-test/tests/azure_iothub_dps/test-turbot-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"akas": [ | ||
"{{ output.resource_aka.value }}", | ||
"{{ output.resource_aka_lower.value }}" | ||
], | ||
"name": "{{ resourceName }}", | ||
"title": "{{ resourceName }}" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select name, title, akas | ||
from azure.azure_iothub_dps | ||
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
variable "resource_name" { | ||
type = string | ||
default = "steampipe-test" | ||
description = "Name of the resource used throughout the test." | ||
} | ||
|
||
variable "azure_environment" { | ||
type = string | ||
default = "public" | ||
description = "Azure environment used for the test." | ||
} | ||
|
||
variable "azure_subscription" { | ||
type = string | ||
default = "3510ae4d-530b-497d-8f30-53c0616fc6c1" | ||
description = "Azure subscription used for the test." | ||
} | ||
|
||
provider "azurerm" { | ||
# Cannot be passed as a variable | ||
version = "=1.36.0" | ||
environment = var.azure_environment | ||
subscription_id = var.azure_subscription | ||
} | ||
|
||
data "azurerm_client_config" "current" {} | ||
|
||
data "null_data_source" "resource" { | ||
inputs = { | ||
scope = "azure:///subscriptions/${data.azurerm_client_config.current.subscription_id}" | ||
} | ||
} | ||
|
||
resource "azurerm_resource_group" "named_test_resource" { | ||
name = var.resource_name | ||
location = "East US" | ||
} | ||
|
||
locals { | ||
path = "${path.cwd}/info.json" | ||
} | ||
|
||
resource "null_resource" "named_test_resource" { | ||
depends_on = [azurerm_resource_group.named_test_resource] | ||
provisioner "local-exec" { | ||
command = "az iot dps create --name ${var.resource_name} --resource-group ${var.resource_name} --location ${azurerm_resource_group.named_test_resource.location} > ${local.path}" | ||
} | ||
} | ||
|
||
data "local_file" "input" { | ||
depends_on = [null_resource.named_test_resource] | ||
filename = local.path | ||
} | ||
|
||
|
||
output "resource_aka" { | ||
depends_on = [null_resource.named_test_resource] | ||
value = "azure://${jsondecode(data.local_file.input.content).id}" | ||
} | ||
|
||
output "resource_aka_lower" { | ||
depends_on = [null_resource.named_test_resource] | ||
value = "azure://${lower(jsondecode(data.local_file.input.content).id)}" | ||
} | ||
|
||
output "resource_name" { | ||
value = var.resource_name | ||
} | ||
|
||
output "resource_id" { | ||
value = jsondecode(data.local_file.input.content).id | ||
} | ||
|
||
output "location" { | ||
value = azurerm_resource_group.named_test_resource.location | ||
} | ||
|
||
output "subscription_id" { | ||
value = var.azure_subscription | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.