-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
b3f45a1
commit 1cabbac
Showing
15 changed files
with
494 additions
and
2 deletions.
There are no files selected for viewing
Empty file.
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 }}", | ||
"region": "{{ output.region.value }}", | ||
"resource_group": "{{ resourceName }}", | ||
"sku_name": "{{ output.sku_name.value }}", | ||
"subscription_id": "{{ output.subscription_id.value }}", | ||
"type": "Microsoft.StorageCache/caches" | ||
} | ||
] |
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, region, resource_group, subscription_id, sku_name | ||
from azure.azure_hpc_cache | ||
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}'; |
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_upper.value }}", | ||
"name": "{{ resourceName }}", | ||
"region": "{{ output.region.value }}", | ||
"resource_group": "{{ resourceName }}", | ||
"sku_name": "{{ output.sku_name.value }}", | ||
"subscription_id": "{{ output.subscription_id.value }}", | ||
"type": "Microsoft.StorageCache/caches" | ||
} | ||
] |
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, region, resource_group, subscription_id, sku_name | ||
from azure.azure_hpc_cache | ||
where name = '{{ resourceName }}'; |
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 |
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, region | ||
from azure.azure_hpc_cache | ||
where name = 'dummy-test{{ resourceName }}' and resource_group = '{{ resourceName }}'; |
10 changes: 10 additions & 0 deletions
10
azure-test/tests/azure_hpc_cache/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,10 @@ | ||
[ | ||
{ | ||
"akas": [ | ||
"{{ output.resource_aka.value }}", | ||
"{{ output.resource_aka_lower.value }}" | ||
], | ||
"name": "{{ resourceName }}", | ||
"title": "{{ resourceName }}" | ||
} | ||
] |
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, akas, title | ||
from azure.azure_hpc_cache | ||
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
variable "resource_name" { | ||
type = string | ||
default = "turbot-test-20201001-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_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_prefixes = ["10.0.1.0/24"] | ||
} | ||
|
||
resource "azurerm_hpc_cache" "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 | ||
cache_size_in_gb = 3072 | ||
subnet_id = azurerm_subnet.named_test_resource.id | ||
sku_name = "Standard_2G" | ||
} | ||
|
||
output "region" { | ||
value = azurerm_resource_group.named_test_resource.location | ||
} | ||
|
||
output "resource_aka" { | ||
depends_on = [azurerm_hpc_cache.named_test_resource] | ||
value = "azure://${azurerm_hpc_cache.named_test_resource.id}" | ||
} | ||
|
||
output "resource_aka_lower" { | ||
value = "azure://${lower(azurerm_hpc_cache.named_test_resource.id)}" | ||
} | ||
|
||
output "resource_name" { | ||
value = var.resource_name | ||
} | ||
|
||
output "resource_id" { | ||
value = azurerm_hpc_cache.named_test_resource.id | ||
} | ||
|
||
output "resource_id_upper" { | ||
value = "/subscriptions/${var.azure_subscription}/resourceGroups/${upper(var.resource_name)}/providers/Microsoft.StorageCache/caches/${var.resource_name}" | ||
} | ||
|
||
output "subscription_id" { | ||
value = var.azure_subscription | ||
} | ||
|
||
output "sku_name" { | ||
value = azurerm_hpc_cache.named_test_resource.sku_name | ||
} |
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.