betr-io / terraform-provider-mssql

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

Use case for a MS SQL database server over a firewall #73

Open federicomanco opened 6 months ago

federicomanco commented 6 months ago

Good morning, This provider is working like a charm, I am able to create users over our MS SQL database servers. After the creation, running terraform plan is triggering the following error: Error: unable to read user [db_name].[user_name]: db connection failed after 30s timeout │ with module.xxx.mssql_user.xxx, │ on ../../../modules/xxx/xxx/1-common.tf line 75, in resource "mssql_user" "xxx": │ 75: resource "mssql_user" "xxx" { Which is perfectly expected because the database server lies over a firewall. In fact, this is going to work fine if I'm adding a firewall rule exception. I was wondering, is there a way to avoid the user to be read after the creation? I tried to add the lifecycle {ignore_changes = all} directive but it's not enough to avoid terraform trying to read from the database. Let me know if you need further specifications. Thanks in advance for your help! Fede

rmmason commented 6 months ago

We are getting the same error but the terraform script works on one developers machine but not another. Both machines are on the same network so this shouldn't be a firewall issue for us.