-
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.
Add missing columns and update Azure Go SDK to use Azure ARM package …
- Loading branch information
Showing
14 changed files
with
327 additions
and
55 deletions.
There are no files selected for viewing
Empty file.
9 changes: 9 additions & 0 deletions
9
azure-test/tests/azure_postgresql_flexible_server/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,9 @@ | ||
[ | ||
{ | ||
"administrator_login": "psqladmin", | ||
"name": "{{ resourceName }}", | ||
"resource_group": "{{ resourceName }}", | ||
"subscription_id": "{{ output.subscription_id.value }}", | ||
"version": "12" | ||
} | ||
] |
3 changes: 3 additions & 0 deletions
3
azure-test/tests/azure_postgresql_flexible_server/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, version, administrator_login, resource_group, subscription_id | ||
from azure_postgresql_flexible_server | ||
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}'; |
6 changes: 6 additions & 0 deletions
6
azure-test/tests/azure_postgresql_flexible_server/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_postgresql_flexible_server/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 id, name | ||
from azure_postgresql_flexible_server | ||
where name = '{{ resourceName }}'; |
1 change: 1 addition & 0 deletions
1
azure-test/tests/azure_postgresql_flexible_server/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 @@ | ||
[] |
3 changes: 3 additions & 0 deletions
3
azure-test/tests/azure_postgresql_flexible_server/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, akas, title | ||
from azure_postgresql_flexible_server | ||
where name = 'dummy-{{ resourceName }}' and resource_group = '{{ resourceName }}'; |
13 changes: 13 additions & 0 deletions
13
azure-test/tests/azure_postgresql_flexible_server/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,13 @@ | ||
[ | ||
{ | ||
"akas": [ | ||
"{{ output.resource_aka.value }}", | ||
"{{ output.resource_aka_lower.value }}" | ||
], | ||
"name": "{{ resourceName }}", | ||
"tags": { | ||
"name": "{{ resourceName }}" | ||
}, | ||
"title": "{{ resourceName }}" | ||
} | ||
] |
3 changes: 3 additions & 0 deletions
3
azure-test/tests/azure_postgresql_flexible_server/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 name, akas, title, tags | ||
from azure_postgresql_flexible_server | ||
where name = '{{ resourceName }}' and resource_group = '{{ resourceName }}'; |
1 change: 1 addition & 0 deletions
1
azure-test/tests/azure_postgresql_flexible_server/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 @@ | ||
{} |
115 changes: 115 additions & 0 deletions
115
azure-test/tests/azure_postgresql_flexible_server/variables.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,115 @@ | ||
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." | ||
} | ||
|
||
terraform { | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "=3.3.0" | ||
} | ||
} | ||
} | ||
|
||
# Configure the Microsoft Azure Provider | ||
provider "azurerm" { | ||
environment = var.azure_environment | ||
subscription_id = var.azure_subscription | ||
features {} | ||
} | ||
|
||
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 | ||
location = azurerm_resource_group.named_test_resource.location | ||
resource_group_name = azurerm_resource_group.named_test_resource.name | ||
address_space = ["10.0.0.0/16"] | ||
} | ||
|
||
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.2.0/24"] | ||
service_endpoints = ["Microsoft.Storage"] | ||
delegation { | ||
name = "fs" | ||
service_delegation { | ||
name = "Microsoft.DBforPostgreSQL/flexibleServers" | ||
actions = [ | ||
"Microsoft.Network/virtualNetworks/subnets/join/action", | ||
] | ||
} | ||
} | ||
} | ||
resource "azurerm_private_dns_zone" "named_test_resource" { | ||
name = "test.${var.resource_name}.postgres.database.azure.com" | ||
resource_group_name = azurerm_resource_group.named_test_resource.name | ||
} | ||
|
||
resource "azurerm_private_dns_zone_virtual_network_link" "named_test_resource" { | ||
name = "${var.resource_name}.com" | ||
private_dns_zone_name = azurerm_private_dns_zone.named_test_resource.name | ||
virtual_network_id = azurerm_virtual_network.named_test_resource.id | ||
resource_group_name = azurerm_resource_group.named_test_resource.name | ||
depends_on = [azurerm_subnet.named_test_resource] | ||
} | ||
|
||
resource "azurerm_postgresql_flexible_server" "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 | ||
version = "12" | ||
delegated_subnet_id = azurerm_subnet.named_test_resource.id | ||
private_dns_zone_id = azurerm_private_dns_zone.named_test_resource.id | ||
administrator_login = "psqladmin" | ||
administrator_password = "H@Sh1CoR3!" | ||
zone = "1" | ||
|
||
storage_mb = 32768 | ||
|
||
sku_name = "GP_Standard_D4s_v3" | ||
depends_on = [azurerm_private_dns_zone_virtual_network_link.named_test_resource] | ||
tags = { | ||
name = var.resource_name | ||
} | ||
|
||
} | ||
|
||
output "resource_aka" { | ||
value = "azure://${azurerm_postgresql_flexible_server.named_test_resource.id}" | ||
} | ||
|
||
output "resource_aka_lower" { | ||
value = "azure://${lower(azurerm_postgresql_flexible_server.named_test_resource.id)}" | ||
} | ||
|
||
output "resource_name" { | ||
value = var.resource_name | ||
} | ||
|
||
output "resource_id" { | ||
value = azurerm_postgresql_flexible_server.named_test_resource.id | ||
} | ||
|
||
output "subscription_id" { | ||
value = var.azure_subscription | ||
} |
Oops, something went wrong.