Skip to content

Commit

Permalink
Add table azure_eventgrid_domain. Closes #293 (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
ParthaI authored Sep 23, 2021
1 parent d769276 commit 0f65df1
Show file tree
Hide file tree
Showing 16 changed files with 561 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"id": "{{ output.resource_id.value }}",
"name": "{{ resourceName }}",
"type": "Microsoft.EventGrid/domains"
}
]
3 changes: 3 additions & 0 deletions azure-test/tests/azure_eventgrid_domain/test-get-query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select name, id, type
from azure.azure_eventgrid_domain
where name = '{{ resourceName }}';
10 changes: 10 additions & 0 deletions azure-test/tests/azure_eventgrid_domain/test-hydrate-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 }}"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select name, akas, title
from azure.azure_eventgrid_domain
where name = '{{ resourceName }}';
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"id": "{{ output.resource_id.value }}",
"name": "{{ resourceName }}"
}
]
3 changes: 3 additions & 0 deletions azure-test/tests/azure_eventgrid_domain/test-list-query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select id, name
from azure.azure_eventgrid_domain
where title = '{{ 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, akas, title
from azure.azure_eventgrid_domain
where name = 'dummy-{{ resourceName }}';
10 changes: 10 additions & 0 deletions azure-test/tests/azure_eventgrid_domain/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_eventgrid_domain/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_eventgrid_domain
where name = '{{ resourceName }}';
66 changes: 66 additions & 0 deletions azure-test/tests/azure_eventgrid_domain/variable.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
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 subscription used for the test."
}

provider "azurerm" {
features {}
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 = "West US"
}

resource "azurerm_eventgrid_domain" "named_test_resource" {
name = var.resource_name
location = azurerm_resource_group.named_test_resource.location
resource_group_name = var.resource_name

tags = {
environment = "Production"
}
}

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

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

output "resource_name" {
value = var.resource_name
}

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

output "subscription_id" {
value = var.azure_subscription
}
1 change: 1 addition & 0 deletions azure-test/tests/azure_eventgrid_domain/variables.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions azure/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func Plugin(ctx context.Context) *plugin.Plugin {
"azure_data_lake_analytics_account": tableAzureDataLakeAnalyticsAccount(ctx),
"azure_data_lake_store": tableAzureDataLakeStore(ctx),
"azure_diagnostic_setting": tableAzureDiagnosticSetting(ctx),
"azure_eventgrid_domain": tableAzureEventGridDomain(ctx),
"azure_eventhub_namespace": tableAzureEventHubNamespace(ctx),
"azure_express_route_circuit": tableAzureExpressRouteCircuit(ctx),
"azure_firewall": tableAzureFirewall(ctx),
Expand Down
Loading

0 comments on commit 0f65df1

Please sign in to comment.