Skip to content

Commit

Permalink
Add table azure_signalr_service. Closes #296 (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
c0d3r-arnab authored Sep 28, 2021
1 parent 3e70c2f commit d5ca7a3
Show file tree
Hide file tree
Showing 14 changed files with 494 additions and 0 deletions.
Empty file.
10 changes: 10 additions & 0 deletions azure-test/tests/azure_signalr_service/test-get-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"id": "{{ output.resource_id.value }}",
"name": "{{ resourceName }}",
"region": "{{ output.region.value }}",
"resource_group": "{{ resourceName }}",
"subscription_id": "{{ output.subscription_id.value }}",
"type": "Microsoft.SignalRService/SignalR"
}
]
3 changes: 3 additions & 0 deletions azure-test/tests/azure_signalr_service/test-get-query.sql
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_signalr_service
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}';
10 changes: 10 additions & 0 deletions azure-test/tests/azure_signalr_service/test-list-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"id": "{{ output.resource_id.value }}",
"name": "{{ resourceName }}",
"region": "{{ output.region.value }}",
"resource_group": "{{ resourceName }}",
"subscription_id": "{{ output.subscription_id.value }}",
"type": "Microsoft.SignalRService/SignalR"
}
]
3 changes: 3 additions & 0 deletions azure-test/tests/azure_signalr_service/test-list-query.sql
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_signalr_service
where id = '{{ output.resource_id.value }}';
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, id, type, region
from azure.azure_signalr_service
where name = 'dummy-test{{ resourceName }}' and resource_group = '{{ resourceName }}';
10 changes: 10 additions & 0 deletions azure-test/tests/azure_signalr_service/test-turbot-expected.json
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 }}"
}
]
3 changes: 3 additions & 0 deletions azure-test/tests/azure_signalr_service/test-turbot-query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select name, akas, title
from azure.azure_signalr_service
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}';
1 change: 1 addition & 0 deletions azure-test/tests/azure_signalr_service/variables.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
74 changes: 74 additions & 0 deletions azure-test/tests/azure_signalr_service/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
variable "resource_name" {
type = string
default = "turbot-test-20200125-create-update"
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 environment used for the test."
}

terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=2.77.0"
}
}
}

provider "azurerm" {
# Cannot be passed as a variable
features {}
environment = var.azure_environment
subscription_id = var.azure_subscription
}

resource "azurerm_resource_group" "named_test_resource" {
name = var.resource_name
location = "West Europe"
}

resource "azurerm_signalr_service" "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

sku {
name = "Free_F1"
capacity = 1
}
}

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

output "resource_aka" {
depends_on = [azurerm_signalr_service.named_test_resource]
value = "azure://${azurerm_signalr_service.named_test_resource.id}"
}

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

output "resource_name" {
value = var.resource_name
}

output "resource_id" {
value = azurerm_signalr_service.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 @@ -114,6 +114,7 @@ func Plugin(ctx context.Context) *plugin.Plugin {
"azure_security_center_subscription_pricing": tableAzureSecurityCenterPricing(ctx),
"azure_service_fabric_cluster": tableAzureServiceFabricCluster(ctx),
"azure_servicebus_namespace": tableAzureServiceBusNamespace(ctx),
"azure_signalr_service": tableAzureSignalRService(ctx),
"azure_sql_database": tableAzureSqlDatabase(ctx),
"azure_sql_server": tableAzureSQLServer(ctx),
"azure_storage_account": tableAzureStorageAccount(ctx),
Expand Down
Loading

0 comments on commit d5ca7a3

Please sign in to comment.