Skip to content

Commit

Permalink
Add table azure_machine_learning_workspace. Closes #294 (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
ParthaI authored Sep 16, 2021
1 parent 34f9d17 commit a65f828
Show file tree
Hide file tree
Showing 14 changed files with 498 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"id": "{{ output.resource_id.value }}",
"name": "{{ resourceName }}",
"region": "{{ output.location.value }}",
"resource_group": "{{ resourceName }}",
"subscription_id": "{{ output.subscription_id.value }}",
"tags": {
"name": "{{ resourceName }}"
},
"type": "Microsoft.MachineLearningServices/workspaces"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select name, id, type, tags, region, resource_group, subscription_id
from azure.azure_machine_learning_workspace
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.MachineLearningServices/workspaces"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select name, id, type
from azure.azure_machine_learning_workspace
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, tags, title, akas
from azure.azure_machine_learning_workspace
where name = 'dummy-{{ resourceName }}' and resource_group = '{{ resourceName }}';
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"akas": [
"{{ output.resource_aka.value }}",
"{{ output.resource_aka_lower.value }}"
],
"name": "{{ resourceName }}",
"tags": {
"name": "{{ resourceName }}"
},
"title": "{{ resourceName }}"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select name, tags, title, akas
from azure.azure_machine_learning_workspace
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
102 changes: 102 additions & 0 deletions azure-test/tests/azure_machine_learning_workspace/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
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 = "=2.41.0"
environment = var.azure_environment
subscription_id = var.azure_subscription
features {}
}

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"
}

resource "azurerm_application_insights" "named_test_resource" {
name = var.resource_name
location = azurerm_resource_group.named_test_resource.location
resource_group_name = azurerm_resource_group.named_test_resource.name
application_type = "web"
}

resource "azurerm_key_vault" "named_test_resource" {
name = var.resource_name
location = azurerm_resource_group.named_test_resource.location
resource_group_name = azurerm_resource_group.named_test_resource.name
tenant_id = data.azurerm_client_config.current.tenant_id
sku_name = "premium"
}

resource "azurerm_storage_account" "named_test_resource" {
name = var.resource_name
location = azurerm_resource_group.named_test_resource.location
resource_group_name = azurerm_resource_group.named_test_resource.name
account_tier = "Standard"
account_replication_type = "GRS"
}

resource "azurerm_machine_learning_workspace" "named_test_resource" {
name = var.resource_name
location = azurerm_resource_group.named_test_resource.location
resource_group_name = azurerm_resource_group.named_test_resource.name
application_insights_id = azurerm_application_insights.named_test_resource.id
key_vault_id = azurerm_key_vault.named_test_resource.id
storage_account_id = azurerm_storage_account.named_test_resource.id

identity {
type = "SystemAssigned"
}

tags = {
"name" = var.resource_name
}
}

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

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

output "resource_name" {
value = var.resource_name
}

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

output "location" {
value = azurerm_resource_group.named_test_resource.location
}

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 @@ -79,6 +79,7 @@ func Plugin(ctx context.Context) *plugin.Plugin {
"azure_log_alert": tableAzureLogAlert(ctx),
"azure_log_profile": tableAzureLogProfile(ctx),
"azure_logic_app_workflow": tableAzureLogicAppWorkflow(ctx),
"azure_machine_learning_workspace": tableAzureMachineLearningWorkspace(ctx),
"azure_management_lock": tableAzureManagementLock(ctx),
"azure_mariadb_server": tableAzureMariaDBServer(ctx),
"azure_mssql_elasticpool": tableAzureMSSQLElasticPool(ctx),
Expand Down
Loading

0 comments on commit a65f828

Please sign in to comment.