sassoftware / viya4-iac-azure

This project contains Terraform configuration files to provision infrastructure components required to deploy SAS Viya platform products on Microsoft Azure Cloud.
Apache License 2.0
74 stars 89 forks source link

connectivity_method=private no longer creates an internal postgres #410

Closed ajeffowens closed 4 days ago

ajeffowens commented 1 week ago

commit 651c565 changed azurerm version from 3.92 to 4.3.0

there is a new variable introduced in the postgres module: public_network_access_enabled

this variable defaults to true. So, setting the viya4-iac-azure var connectivity_method to private does not create a private postgres anymore.

So this postgres_server block:

   "postgres_servers": {
    "default": {
      "administrator_password": "***",
      "connectivity_method": "private",
      "postgresql_configurations": [
        {
          "name": "azure.extensions",
          "value": "LTREE"
        }
      ]
    }
  },

With this postgresql subnet defintion:

"postgresql": {
      "prefixes": [
        "192.168.5.0/24"
      ],
      "private_endpoint_network_policies": "Disabled",
      "private_link_service_network_policies_enabled": false,
      "service_delegations": {
        "flexpostgres": {
          "actions": [
            "Microsoft.Network/virtualNetworks/subnets/join/action"
          ],
          "name": "Microsoft.DBforPostgreSQL/flexibleServers"
        }
      },
      "service_endpoints": [
        "Microsoft.KeyVault"
      ]
    }

Now results in this error:

╷
│ Error: creating Flexible Server (Subscription: "693fe151-300d-4b8e-a478-3871749a4eb7"
│ Resource Group Name: "jotrials-csinfs3-rg"
│ Flexible Server Name: "jotrials-csinfs3-default-flexpsql"): performing Create: unexpected status 400 (400 Bad Request) with error: ConflictingPublicNetworkAccessAndVirtualNetworkConfiguration: Conflicting configuration is detected between Public Network Access and Virtual Network arguments. Public Network Access is not supported along with Virtual Network feature.
│ 
│   with module.flex_postgresql["default"].azurerm_postgresql_flexible_server.flexpsql,
│   on modules/azurerm_postgresql_flex/main.tf line 26, in resource "azurerm_postgresql_flexible_server" "flexpsql":
│   26: resource "azurerm_postgresql_flexible_server" "flexpsql" {
│