Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table azure_search_service closes #240 #257

Merged
merged 13 commits into from
Aug 12, 2021
Empty file.
14 changes: 14 additions & 0 deletions azure-test/tests/azure_search_service/test-get-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"id": "{{ output.resource_id.value }}",
"name": "{{ resourceName }}",
"provisioning_state": "succeeded",
"region": "east us",
bigdatasourav marked this conversation as resolved.
Show resolved Hide resolved
"resource_group": "{{ resourceName }}",
"sku_name": "standard",
"status": "running",
"subscription_id": "{{ output.subscription_id.value }}",
"tags_src": {},
"type": "Microsoft.Search/searchServices"
}
]
3 changes: 3 additions & 0 deletions azure-test/tests/azure_search_service/test-get-query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select name, id, type, status, provisioning_state, sku_name, tags_src, resource_group, region, subscription_id
from azure.azure_search_service
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}';
10 changes: 10 additions & 0 deletions azure-test/tests/azure_search_service/test-hydrate-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"name": "{{ resourceName }}",
"network_rule_set": {
"ipRules": []
},
"partition_count": 1,
"replica_count": 1
}
]
3 changes: 3 additions & 0 deletions azure-test/tests/azure_search_service/test-hydrate-query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select name, replica_count, partition_count, network_rule_set
from azure.azure_search_service
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}';
7 changes: 7 additions & 0 deletions azure-test/tests/azure_search_service/test-list-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"id": "{{ output.resource_id.value }}",
"name": "{{ resourceName }}",
"region": "east us"
}
]
3 changes: 3 additions & 0 deletions azure-test/tests/azure_search_service/test-list-query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select id, name, region
from azure.azure_search_service
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, akas, title
from azure.azure_search_service
where name = 'dummy-{{ resourceName }}' and resource_group = '{{ resourceName }}';
10 changes: 10 additions & 0 deletions azure-test/tests/azure_search_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 }}"
}
]
khushboo9024 marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions azure-test/tests/azure_search_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_search_service
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}';
1 change: 1 addition & 0 deletions azure-test/tests/azure_search_service/variables.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
70 changes: 70 additions & 0 deletions azure-test/tests/azure_search_service/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

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" {
# Cannot be passed as a variable
version = "=2.50.0"
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 = "East US"
}

resource "azurerm_search_service" "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
sku = "standard"
}

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

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

output "resource_name" {
value = var.resource_name
}

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

output "location" {
value = lower(azurerm_search_service.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 @@ -88,6 +88,7 @@ func Plugin(ctx context.Context) *plugin.Plugin {
"azure_role_assignment": tableAzureIamRoleAssignment(ctx),
"azure_role_definition": tableAzureIamRoleDefinition(ctx),
"azure_route_table": tableAzureRouteTable(ctx),
"azure_search_service": tableAzureSearchService(ctx),
"azure_security_center_auto_provisioning": tableAzureSecurityCenterAutoProvisioning(ctx),
"azure_security_center_contact": tableAzureSecurityCenterContact(ctx),
"azure_security_center_jit_network_access_policy": tableAzureSecurityCenterJITNetworkAccessPolicy(ctx),
Expand Down
Loading