forked from turbot/steampipe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
584 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
azure-test/tests/azure_compute_virtual_machine_scale_set/test-get-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[ | ||
{ | ||
"id": "{{ output.resource_id.value }}", | ||
"name": "{{ resourceName }}", | ||
"sku_name": "Standard_F2", | ||
"sku_tier": "Standard", | ||
"tags": { | ||
"Name": "{{ resourceName }}" | ||
} | ||
} | ||
] |
3 changes: 3 additions & 0 deletions
3
azure-test/tests/azure_compute_virtual_machine_scale_set/test-get-query.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select name, id, sku_tier, sku_name, tags | ||
from azure.azure_compute_virtual_machine_scale_set | ||
where name = '{{resourceName}}' and resource_group = '{{resourceName}}'; |
7 changes: 7 additions & 0 deletions
7
azure-test/tests/azure_compute_virtual_machine_scale_set/test-hydrate-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ | ||
{ | ||
"id": "{{ output.resource_id.value }}", | ||
"name": "{{ resourceName }}", | ||
"type": "Microsoft.Compute/virtualMachineScaleSets" | ||
} | ||
] |
3 changes: 3 additions & 0 deletions
3
azure-test/tests/azure_compute_virtual_machine_scale_set/test-hydrate-query.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select name, id, type | ||
from azure.azure_compute_virtual_machine_scale_set | ||
where name = '{{resourceName}}' and resource_group = '{{resourceName}}'; |
6 changes: 6 additions & 0 deletions
6
azure-test/tests/azure_compute_virtual_machine_scale_set/test-list-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
3
azure-test/tests/azure_compute_virtual_machine_scale_set/test-list-query.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select name, id | ||
from azure.azure_compute_virtual_machine_scale_set | ||
where id = '{{ output.resource_id.value }}'; |
1 change: 1 addition & 0 deletions
1
azure-test/tests/azure_compute_virtual_machine_scale_set/test-not-found-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
null |
3 changes: 3 additions & 0 deletions
3
azure-test/tests/azure_compute_virtual_machine_scale_set/test-not-found-query.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select name, id | ||
from azure.azure_compute_virtual_machine_scale_set | ||
where name = 'dummy{{ resourceName }}' and resource_group = '{{ resourceName }}'; |
12 changes: 12 additions & 0 deletions
12
azure-test/tests/azure_compute_virtual_machine_scale_set/test-turbot-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[ | ||
{ | ||
"akas": [ | ||
"{{ output.resource_aka.value }}", | ||
"{{ output.resource_aka_lower.value }}" | ||
], | ||
"tags": { | ||
"Name": "{{ resourceName }}" | ||
}, | ||
"title": "{{ resourceName }}" | ||
} | ||
] |
3 changes: 3 additions & 0 deletions
3
azure-test/tests/azure_compute_virtual_machine_scale_set/test-turbot-query.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select title, akas, tags | ||
from azure.azure_compute_virtual_machine_scale_set | ||
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}'; |
170 changes: 170 additions & 0 deletions
170
azure-test/tests/azure_compute_virtual_machine_scale_set/varable.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
|
||
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 = "=1.36.0" | ||
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_virtual_network" "named_test_resource" { | ||
name = var.resource_name | ||
address_space = ["10.0.0.0/16"] | ||
location = azurerm_resource_group.named_test_resource.location | ||
resource_group_name = azurerm_resource_group.named_test_resource.name | ||
} | ||
|
||
resource "azurerm_subnet" "named_test_resource" { | ||
name = var.resource_name | ||
resource_group_name = azurerm_resource_group.named_test_resource.name | ||
virtual_network_name = azurerm_virtual_network.named_test_resource.name | ||
address_prefix = "10.0.2.0/24" | ||
} | ||
|
||
resource "azurerm_public_ip" "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 | ||
allocation_method = "Static" | ||
domain_name_label = azurerm_resource_group.named_test_resource.name | ||
|
||
tags = { | ||
Name = var.resource_name | ||
} | ||
} | ||
|
||
resource "azurerm_lb" "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 | ||
|
||
frontend_ip_configuration { | ||
name = "PublicIPAddress" | ||
public_ip_address_id = azurerm_public_ip.named_test_resource.id | ||
} | ||
} | ||
|
||
resource "azurerm_lb_backend_address_pool" "named_test_resource" { | ||
resource_group_name = azurerm_resource_group.named_test_resource.name | ||
loadbalancer_id = azurerm_lb.named_test_resource.id | ||
name = var.resource_name | ||
} | ||
|
||
resource "azurerm_lb_nat_pool" "named_test_resource" { | ||
resource_group_name = azurerm_resource_group.named_test_resource.name | ||
name = "ssh" | ||
loadbalancer_id = azurerm_lb.named_test_resource.id | ||
protocol = "Tcp" | ||
frontend_port_start = 50000 | ||
frontend_port_end = 50119 | ||
backend_port = 22 | ||
frontend_ip_configuration_name = "PublicIPAddress" | ||
} | ||
|
||
resource "azurerm_virtual_machine_scale_set" "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 | ||
|
||
upgrade_policy_mode = "Manual" | ||
|
||
sku { | ||
name = "Standard_F2" | ||
tier = "Standard" | ||
capacity = 2 | ||
} | ||
|
||
storage_profile_image_reference { | ||
publisher = "Canonical" | ||
offer = "UbuntuServer" | ||
sku = "16.04-LTS" | ||
version = "latest" | ||
} | ||
|
||
storage_profile_os_disk { | ||
name = "" | ||
caching = "ReadWrite" | ||
create_option = "FromImage" | ||
managed_disk_type = "Standard_LRS" | ||
} | ||
|
||
storage_profile_data_disk { | ||
lun = 0 | ||
caching = "ReadWrite" | ||
create_option = "Empty" | ||
disk_size_gb = 10 | ||
} | ||
|
||
os_profile { | ||
computer_name_prefix = "testvm" | ||
admin_username = "myadmin" | ||
admin_password = "AdminPassword@123" | ||
} | ||
|
||
os_profile_linux_config { | ||
disable_password_authentication = false | ||
} | ||
|
||
network_profile { | ||
name = "terraformnetworkprofile" | ||
primary = true | ||
|
||
ip_configuration { | ||
name = "TestIPConfiguration" | ||
primary = true | ||
subnet_id = azurerm_subnet.named_test_resource.id | ||
load_balancer_backend_address_pool_ids = [azurerm_lb_backend_address_pool.named_test_resource.id] | ||
load_balancer_inbound_nat_rules_ids = [azurerm_lb_nat_pool.named_test_resource.id] | ||
} | ||
} | ||
|
||
tags = { | ||
Name = var.resource_name | ||
} | ||
} | ||
|
||
output "resource_aka" { | ||
value = "azure://${azurerm_virtual_machine_scale_set.named_test_resource.id}" | ||
} | ||
|
||
output "resource_aka_lower" { | ||
value = "azure://${lower(azurerm_virtual_machine_scale_set.named_test_resource.id)}" | ||
} | ||
|
||
output "resource_name" { | ||
value = var.resource_name | ||
} | ||
|
||
output "resource_id" { | ||
value = azurerm_virtual_machine_scale_set.named_test_resource.id | ||
} |
1 change: 1 addition & 0 deletions
1
azure-test/tests/azure_compute_virtual_machine_scale_set/variables.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.