Skip to content

Commit

Permalink
Add table azure_data_lake_store. Closes #209 (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
bigdatasourav authored Aug 5, 2021
1 parent 4a4751c commit f4e5356
Show file tree
Hide file tree
Showing 14 changed files with 487 additions and 0 deletions.
Empty file.
9 changes: 9 additions & 0 deletions azure-test/tests/azure_data_lake_store/test-get-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"id": "{{ output.resource_id.value }}",
"name": "{{ resourceName }}",
"resource_group": "{{ resourceName }}",
"subscription_id": "{{ output.subscription_id.value }}",
"type": "Microsoft.DataLakeStore/accounts"
}
]
3 changes: 3 additions & 0 deletions azure-test/tests/azure_data_lake_store/test-get-query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select name, id, type, resource_group, subscription_id
from azure.azure_data_lake_store
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"id": "{{ output.resource_id.value }}",
"name": "{{ resourceName }}",
"type": "Microsoft.DataLakeStore/accounts"
}
]
3 changes: 3 additions & 0 deletions azure-test/tests/azure_data_lake_store/test-list-query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select name, id, type
from azure.azure_data_lake_store
where name = '{{ resourceName }}';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
null
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select name
from azure.azure_data_lake_store
where name = 'dummy-{{ resourceName }}' and resource_group = '{{ resourceName }}';
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"akas": [
"{{ output.resource_aka.value }}",
"{{ output.resource_aka_lower.value }}"
],
"title": "{{ resourceName }}"
}
]
3 changes: 3 additions & 0 deletions azure-test/tests/azure_data_lake_store/test-turbot-query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select title, akas
from azure.azure_data_lake_store
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}';
1 change: 1 addition & 0 deletions azure-test/tests/azure_data_lake_store/variables.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
65 changes: 65 additions & 0 deletions azure-test/tests/azure_data_lake_store/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
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-53b9616fc6c1"
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 US2"
}

resource "azurerm_data_lake_store" "named_test_resource" {
name = var.resource_name
resource_group_name = azurerm_resource_group.named_test_resource.name
location = azurerm_resource_group.named_test_resource.location
encryption_state = "Enabled"
encryption_type = "ServiceManaged"
}

output "resource_aka" {
value = "azure://${azurerm_data_lake_store.named_test_resource.id}"
}

output "resource_aka_lower" {
value = "azure://${lower(azurerm_data_lake_store.named_test_resource.id)}"
}

output "resource_name" {
value = var.resource_name
}

output "resource_id" {
value = azurerm_data_lake_store.named_test_resource.id
}

output "subscription_id" {
value = var.azure_subscription
}
1 change: 1 addition & 0 deletions azure/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func Plugin(ctx context.Context) *plugin.Plugin {
"azure_data_factory": tableAzureDataFactory(ctx),
"azure_data_factory_dataset": tableAzureDataFactoryDataset(ctx),
"azure_data_factory_pipeline": tableAzureDataFactoryPipeline(ctx),
"azure_data_lake_store": tableAzureDataLakeStore(ctx),
"azure_diagnostic_setting": tableAzureDiagnosticSetting(ctx),
"azure_eventhub_namespace": tableAzureEventHubNamespace(ctx),
"azure_express_route_circuit": tableAzureExpressRouteCircuit(ctx),
Expand Down
Loading

0 comments on commit f4e5356

Please sign in to comment.