betr-io / terraform-provider-mssql

Terraform provider for Microsoft SQL Server
https://registry.terraform.io/providers/betr-io/mssql/latest
MIT License
35 stars 28 forks source link

Cannot login using only env vars #44

Closed rdbartram closed 2 years ago

rdbartram commented 2 years ago

When trying to create a mssql_user resource using only azure client secrets provided by envvars, i get the error

on of login,azure_login must be specified

resource "mssql_user" "user" {
  server {
    host = "test.com"
  }

  username = "test"
  roles         = ["db_owner"]
}

expected:

read values from envvars, so i dont need to pass them explicitly into the module.

alxy commented 2 years ago

You need to at least define the block, but can leave it empty in case you want to source the credentials from environment variables:

resource "mssql_login" "example" {
  server {
    host = "example-sql-server.database.windows.net"
    azure_login {}
  }
  login_name = "testlogin"
}
rdbartram commented 2 years ago

i thought i tried this already and it complained I needed to have then the properties set...it seems to be working now though. thanks