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_spring_cloud_service. Closes #312 #347

Merged
merged 4 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
13 changes: 13 additions & 0 deletions azure-test/tests/azure_spring_cloud_service/test-get-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"id": "{{ output.resource_id.value }}",
"name": "{{ resourceName }}",
"region": "{{ output.region.value }}",
"resource_group": "{{ resourceName }}",
"subscription_id": "{{ output.subscription_id.value }}",
"tags": {
"name": "{{ resourceName }}"
},
"type": "Microsoft.AppPlatform/Spring"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select name, id, type, region, resource_group, subscription_id, tags
from azure.azure_spring_cloud_service
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}';
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"id": "{{ output.resource_id.value }}",
"name": "{{ resourceName }}",
"region": "{{ output.region.value }}",
"resource_group": "{{ resourceName }}",
"subscription_id": "{{ output.subscription_id.value }}",
"tags": {
"name": "{{ resourceName }}"
},
"type": "Microsoft.AppPlatform/Spring"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select name, id, type, region, resource_group, subscription_id, tags
from azure.azure_spring_cloud_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_spring_cloud_service
where name = 'dummy-test{{ 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, akas, title, tags
from azure.azure_spring_cloud_service
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}';
1 change: 1 addition & 0 deletions azure-test/tests/azure_spring_cloud_service/variables.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
92 changes: 92 additions & 0 deletions azure-test/tests/azure_spring_cloud_service/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
variable "resource_name" {
type = string
default = "turbot-test-20200928-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.78.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_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_spring_cloud_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_name = "S0"

config_server_git_setting {
uri = "https://github.com/Azure-Samples/piggymetrics"
label = "config"
search_paths = ["dir1", "dir2"]
}

trace {
connection_string = azurerm_application_insights.named_test_resource.connection_string
sample_rate = 10.0
}

tags = {
name = var.resource_name
}
}

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

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

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

output "resource_name" {
value = var.resource_name
}

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