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_express_route_circuit. Closes #153 #170

Merged
merged 8 commits into from
Jul 8, 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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
{
"id": "{{ output.resource_id.value }}",
"name": "{{ resourceName }}",
"resource_group": "{{ resourceName }}",
"sku_tier": "{{ output.sku_tire.value }}"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select name, id, sku_tier, resource_group
from azure.azure_express_route_circuit
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}';
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"akas": [
"{{ output.resource_aka.value }}",
"{{ output.resource_aka_lower.value }}"
],
"name": "{{ resourceName }}",
"sku_name": "{{ output.sku_tire.value }}_{{ output.sku_family.value }}",
"sku_tier": "{{ output.sku_tire.value }}",
"tags": {
"Name": "{{ resourceName }}"
},
"title": "{{ resourceName }}"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select name, sku_name, sku_tier, akas, tags, title
from azure.azure_express_route_circuit
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}';
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"id": "{{ output.resource_id.value }}",
"name": "{{ resourceName }}"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select id, name
from azure.azure_express_route_circuit
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, tags, title
from azure.azure_express_route_circuit
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, akas, title, tags
from azure.azure_express_route_circuit
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
84 changes: 84 additions & 0 deletions azure-test/tests/azure_express_route_circuit/varibles.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
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.43.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 = "West US"
}

resource "azurerm_express_route_circuit" "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
service_provider_name = "Equinix"
peering_location = "Silicon Valley"
bandwidth_in_mbps = 50

sku {
tier = "Standard"
family = "MeteredData"
}

tags = {
Name = var.resource_name
}
}

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

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

output "sku_tire" {
value = "Standard"
}

output "sku_family" {
value = "MeteredData"
}

output "resource_name" {
value = var.resource_name
}

output "resource_id" {
value = azurerm_express_route_circuit.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 @@ -42,6 +42,7 @@ func Plugin(ctx context.Context) *plugin.Plugin {
"azure_cosmosdb_mongo_database": tableAzureCosmosDBMongoDatabase(ctx),
"azure_cosmosdb_sql_database": tableAzureCosmosDBSQLDatabase(ctx),
"azure_diagnostic_setting": tableAzureDiagnosticSetting(ctx),
"azure_express_route_circuit": tableAzureExpressRouteCircuit(ctx),
"azure_firewall": tableAzureFirewall(ctx),
"azure_key_vault": tableAzureKeyVault(ctx),
"azure_key_vault_key": tableAzureKeyVaultKey(ctx),
Expand Down
Loading