Skip to content

Commit

Permalink
Merge pull request #26 from avinor/deprecated
Browse files Browse the repository at this point in the history
Upgrade providers
  • Loading branch information
yngveh authored Jan 30, 2024
2 parents 918f823 + 9a29221 commit 510d1b5
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 1,070 deletions.
18 changes: 4 additions & 14 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.69.0"
version = "~> 3.89.0"
}
http = {
source = "hashicorp/http"
version = "~> 3.1.0"
version = "~> 3.4.1"
}
postgresql = {
source = "cyrilgdn/postgresql"
version = "~> 1.17.1"
version = "~> 1.21.0"
}
random = {
source = "hashicorp/random"
version = "~> 3.4.3"
version = "~> 3.6.0"
}
}
}
Expand Down Expand Up @@ -145,11 +145,6 @@ resource "azurerm_monitor_diagnostic_setting" "namespace" {
}
content {
category = enabled_log.value

retention_policy {
enabled = false
days = 0
}
}
}

Expand All @@ -161,11 +156,6 @@ resource "azurerm_monitor_diagnostic_setting" "namespace" {
content {
category = metric.value
enabled = contains(local.parsed_diag.metric, "all") || contains(local.parsed_diag.metric, metric.value)

retention_policy {
enabled = false
days = 0
}
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions test/Makefile

This file was deleted.

28 changes: 0 additions & 28 deletions test/example_ut_test.go

This file was deleted.

57 changes: 0 additions & 57 deletions test/go.mod

This file was deleted.

968 changes: 0 additions & 968 deletions test/go.sum

This file was deleted.

49 changes: 49 additions & 0 deletions tests/diagnostics.tftest.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
variables {
name = "simple"
resource_group_name = "simple-postgresql-rg"
location = "westeurope"

sku = {
capacity = 1
tier = "Basic"
family = "Gen5"
}

geo_redundant_backup = "Enabled"
storage_auto_grow = "Disabled"

databases = [
{
name = "my_database"
charset = "UTF8"
collation = "English_United States.1252"
users = [
{
name = "a_user"
password = null
grants = [
{
object_type : "database"
privileges : ["CREATE"]
},
{
object_type : "table"
privileges : ["SELECT", "INSERT", "UPDATE"]
}
]
},
]
},
]

diagnostics = {
destination = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-rg/providers/Microsoft.OperationalInsights/workspaces/my-log-analytics"
eventhub_name = null
logs = ["PostgreSQLLogs"]
metrics = ["all"]
}
}

run "simple" {
command = plan
}
57 changes: 57 additions & 0 deletions tests/password.tftest.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
variables {
name = "password"
resource_group_name = "password-postgresql-rg"
location = "westeurope"

sku = {
capacity = 1
tier = "Basic"
family = "Gen5"
}

geo_redundant_backup = "Enabled"
storage_auto_grow = "Disabled"
administrator_password = "secretpassword"

databases = [
{
name = "my_database"
charset = "UTF8"
collation = "English_United States.1252"
users = [
{
name = "a_user"
password = null
grants = [
{
object_type : "database"
privileges : ["CREATE"]
},
{
object_type : "table"
privileges : ["SELECT", "INSERT", "UPDATE"]
}
]
},
{
name = "a_user2"
password = "secretpassword"
grants = [
{
object_type : "database"
privileges : ["CREATE"]
},
{
object_type : "table"
privileges : ["SELECT", "INSERT", "UPDATE"]
}
]
},
]
},
]
}

run "simple" {
command = plan
}
42 changes: 42 additions & 0 deletions tests/simple.tftest.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
variables {
name = "simple"
resource_group_name = "simple-postgresql-rg"
location = "westeurope"

sku = {
capacity = 1
tier = "Basic"
family = "Gen5"
}

geo_redundant_backup = "Enabled"
storage_auto_grow = "Disabled"

databases = [
{
name = "my_database"
charset = "UTF8"
collation = "English_United States.1252"
users = [
{
name = "a_user"
password = null
grants = [
{
object_type : "database"
privileges : ["CREATE"]
},
{
object_type : "table"
privileges : ["SELECT", "INSERT", "UPDATE"]
}
]
},
]
},
]
}

run "simple" {
command = plan
}

0 comments on commit 510d1b5

Please sign in to comment.