Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added new resources and datasources #93

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ValeruS
Copy link
Contributor

@ValeruS ValeruS commented Aug 19, 2024

Hi, @magne

This PR introduces a new resources and datasources

the list of new datasources:

  • user (docs/acctest)
  • login (docs/acctest)
  • database_schema (docs/acctest)
  • database_role (docs/acctest)
  • database_permission (docs/acctest)
  • database_credential (docs/acctest)
  • azure_external_datasource (docs/acctest) is limited to Azure SQL Database only

the list of new resources:

  • database_schema (docs/acctest)
  • database_role (docs/acctest)
  • database_permission (docs/acctest)
  • database_masterkey (docs/acctest)
  • database_credential (docs/acctest)
  • azure_external_datasource (docs/acctest) is limited to Azure SQL Database only

SQL user create functionality has been updated for authType = EXTERNAL

  • the second plan show update in place changing role from to

SQL user delete functionality has been updated

  • when you try to delete a user and it is the owner of the role/schema, it is not possible until you change the owner (SQL error)

Implemented validation for names/password

@ValeruS
Copy link
Contributor Author

ValeruS commented Aug 19, 2024

The full list of acctest

Apply complete! Resources: 15 added, 0 changed, 0 destroyed.
[local: terraform-provider-mssql ]$ TESTARGS=-count=1 make testacc
if [ -f .local.env ]; then source .local.env; fi && TF_ACC=1 TERRAFORM_VERSION="~> 1.5" go test github.com/betr-io/terraform-provider-mssql/mssql -v -count=1 -timeout 120m
=== RUN TestAccDataAzureExternalDatasource_Azure_Basic
--- PASS: TestAccDataAzureExternalDatasource_Azure_Basic (19.85s)
=== RUN TestAccDataDatabaseCredential_Azure_Basic
--- PASS: TestAccDataDatabaseCredential_Azure_Basic (14.03s)
=== RUN TestAccDataDatabasePermissions_Local_Basic
--- PASS: TestAccDataDatabasePermissions_Local_Basic (4.26s)
=== RUN TestAccDataDatabasePermissions_Azure_Basic
--- PASS: TestAccDataDatabasePermissions_Azure_Basic (20.67s)
=== RUN TestAccDataDatabaseRole_Local_Basic
--- PASS: TestAccDataDatabaseRole_Local_Basic (3.41s)
=== RUN TestAccDataDatabaseRole_Azure_Basic
--- PASS: TestAccDataDatabaseRole_Azure_Basic (12.46s)
=== RUN TestAccDataDatabaseSchema_Local_Basic
--- PASS: TestAccDataDatabaseSchema_Local_Basic (3.34s)
=== RUN TestAccDataDatabaseSchema_Azure_Basic
--- PASS: TestAccDataDatabaseSchema_Azure_Basic (12.00s)
=== RUN TestAccDataLogin_Local_Basic
--- PASS: TestAccDataLogin_Local_Basic (3.57s)
=== RUN TestAccDataLogin_Azure_Basic
--- PASS: TestAccDataLogin_Azure_Basic (13.48s)
=== RUN TestAccDataUser_Local_Basic
--- PASS: TestAccDataUser_Local_Basic (3.90s)
=== RUN TestAccDataUser_Azure_Basic
--- PASS: TestAccDataUser_Azure_Basic (21.10s)
=== RUN TestProvider
--- PASS: TestProvider (0.00s)
=== RUN TestAccAzureExternalDatasource_Azure_BasicImport
--- PASS: TestAccAzureExternalDatasource_Azure_BasicImport (19.54s)
=== RUN TestAccAzureExternalDatasource_Azure_Basic
--- PASS: TestAccAzureExternalDatasource_Azure_Basic (20.90s)
=== RUN TestAccAzureExternalDatasource_Azure_Basic_update
--- PASS: TestAccAzureExternalDatasource_Azure_Basic_update (25.96s)
=== RUN TestAccDatabaseCredential_Azure_BasicImport
--- PASS: TestAccDatabaseCredential_Azure_BasicImport (14.32s)
=== RUN TestAccDatabaseCredential_Azure_Basic
--- PASS: TestAccDatabaseCredential_Azure_Basic (11.33s)
=== RUN TestAccDatabaseCredential_Azure_Basic_update
--- PASS: TestAccDatabaseCredential_Azure_Basic_update (19.98s)
=== RUN TestAccDatabaseMasterkey_Local_Basic
--- PASS: TestAccDatabaseMasterkey_Local_Basic (2.18s)
=== RUN TestAccDatabaseMasterkey_Local_Basic_update
--- PASS: TestAccDatabaseMasterkey_Local_Basic_update (4.02s)
=== RUN TestAccDatabasePermissions_Local_BasicImport
--- PASS: TestAccDatabasePermissions_Local_BasicImport (4.27s)
=== RUN TestAccDatabasePermissions_Local_Basic
--- PASS: TestAccDatabasePermissions_Local_Basic (3.37s)
=== RUN TestAccDatabasePermissions_Local_Basic_update_1
--- PASS: TestAccDatabasePermissions_Local_Basic_update_1 (5.88s)
=== RUN TestAccDatabasePermissions_Local_Basic_update_2
--- PASS: TestAccDatabasePermissions_Local_Basic_update_2 (5.97s)
=== RUN TestAccDatabasePermissions_Azure_Basic
--- PASS: TestAccDatabasePermissions_Azure_Basic (14.50s)
=== RUN TestAccDatabaseRole_Local_BasicImport
--- PASS: TestAccDatabaseRole_Local_BasicImport (2.92s)
=== RUN TestAccDatabaseRole_Local_Basic_Create
--- PASS: TestAccDatabaseRole_Local_Basic_Create (2.16s)
=== RUN TestAccDatabaseRole_Local_Basic_Create_owner
--- PASS: TestAccDatabaseRole_Local_Basic_Create_owner (3.60s)
=== RUN TestAccDatabaseRole_Azure_Basic_Create
--- PASS: TestAccDatabaseRole_Azure_Basic_Create (8.75s)
=== RUN TestAccDatabaseRole_Azure_Basic_Create_owner
--- PASS: TestAccDatabaseRole_Azure_Basic_Create_owner (17.74s)
=== RUN TestAccDatabaseRole_Local_Basic_Update
--- PASS: TestAccDatabaseRole_Local_Basic_Update (4.06s)
=== RUN TestAccDatabaseRole_Local_Basic_Update_owner
--- PASS: TestAccDatabaseRole_Local_Basic_Update_owner (7.33s)
=== RUN TestAccDatabaseRole_Local_Basic_Remove_owner
--- PASS: TestAccDatabaseRole_Local_Basic_Remove_owner (6.25s)
=== RUN TestAccDatabaseRole_Azure_Basic_Update
--- PASS: TestAccDatabaseRole_Azure_Basic_Update (13.65s)
=== RUN TestAccDatabaseRole_Azure_Basic_Update_owner
--- PASS: TestAccDatabaseRole_Azure_Basic_Update_owner (21.31s)
=== RUN TestAccDatabaseSchema_Local_BasicImport
--- PASS: TestAccDatabaseSchema_Local_BasicImport (2.95s)
=== RUN TestAccDatabaseSchema_Local_Basic_Create
--- PASS: TestAccDatabaseSchema_Local_Basic_Create (2.20s)
=== RUN TestAccDatabaseSchema_Local_Basic_Create_owner
--- PASS: TestAccDatabaseSchema_Local_Basic_Create_owner (3.67s)
=== RUN TestAccDatabaseSchema_Azure_Basic_Create
--- PASS: TestAccDatabaseSchema_Azure_Basic_Create (7.15s)
=== RUN TestAccDatabaseSchema_Azure_Basic_Create_owner
--- PASS: TestAccDatabaseSchema_Azure_Basic_Create_owner (15.35s)
=== RUN TestAccDatabaseSchema_Local_Basic_Update_owner
--- PASS: TestAccDatabaseSchema_Local_Basic_Update_owner (7.39s)
=== RUN TestAccDatabaseSchema_Local_Basic_Update_remove_owner
--- PASS: TestAccDatabaseSchema_Local_Basic_Update_remove_owner (6.02s)
=== RUN TestAccDatabaseSchema_Azure_Basic_Update_owner
--- PASS: TestAccDatabaseSchema_Azure_Basic_Update_owner (21.26s)
=== RUN TestAccLogin_Local_BasicImport
--- PASS: TestAccLogin_Local_BasicImport (3.14s)
=== RUN TestAccLogin_Local_Basic
--- PASS: TestAccLogin_Local_Basic (2.73s)
=== RUN TestAccLogin_Local_Basic_SID
--- PASS: TestAccLogin_Local_Basic_SID (2.70s)
=== RUN TestAccLogin_Azure_Basic
--- PASS: TestAccLogin_Azure_Basic (8.45s)
=== RUN TestAccLogin_Azure_Basic_SID
--- PASS: TestAccLogin_Azure_Basic_SID (8.89s)
=== RUN TestAccLogin_Local_UpdateLoginName
--- PASS: TestAccLogin_Local_UpdateLoginName (5.37s)
=== RUN TestAccLogin_Local_UpdatePassword
--- PASS: TestAccLogin_Local_UpdatePassword (4.89s)
=== RUN TestAccLogin_Local_UpdateDefaultDatabase
--- PASS: TestAccLogin_Local_UpdateDefaultDatabase (4.83s)
=== RUN TestAccLogin_Local_UpdateDefaultLanguage
--- PASS: TestAccLogin_Local_UpdateDefaultLanguage (4.84s)
=== RUN TestAccLogin_Azure_UpdateLoginName
--- PASS: TestAccLogin_Azure_UpdateLoginName (16.78s)
=== RUN TestAccLogin_Azure_UpdatePassword
--- PASS: TestAccLogin_Azure_UpdatePassword (14.28s)
=== RUN TestAccUser_Local_BasicImport
--- PASS: TestAccUser_Local_BasicImport (3.58s)
=== RUN TestAccUser_Local_Instance
--- PASS: TestAccUser_Local_Instance (3.10s)
=== RUN TestAccMultipleUsers_Local_Instance
--- PASS: TestAccMultipleUsers_Local_Instance (5.53s)
=== RUN TestAccUser_Azure_Instance
--- PASS: TestAccUser_Azure_Instance (14.86s)
=== RUN TestAccUser_Azure_Database
--- PASS: TestAccUser_Azure_Database (12.21s)
=== RUN TestAccUser_AzureadChain_Database
--- PASS: TestAccUser_AzureadChain_Database (13.90s)
=== RUN TestAccUser_AzureadMSI_Database
--- PASS: TestAccUser_AzureadMSI_Database (13.30s)
=== RUN TestAccUser_Azure_External
--- PASS: TestAccUser_Azure_External (9.32s)
=== RUN TestAccUser_AzureadChain_External
--- PASS: TestAccUser_AzureadChain_External (11.68s)
=== RUN TestAccUser_AzureadMSI_External
--- PASS: TestAccUser_AzureadMSI_External (11.66s)
=== RUN TestAccUser_Local_Update_DefaultSchema
--- PASS: TestAccUser_Local_Update_DefaultSchema (5.30s)
=== RUN TestAccUser_Local_Update_DefaultLanguage
--- PASS: TestAccUser_Local_Update_DefaultLanguage (4.52s)
=== RUN TestAccUser_Local_Update_Roles
--- PASS: TestAccUser_Local_Update_Roles (8.98s)
=== RUN TestAccUser_Azure_Update_DefaultSchema
--- PASS: TestAccUser_Azure_Update_DefaultSchema (27.33s)
=== RUN TestAccUser_Azure_Update_DefaultLanguage
--- PASS: TestAccUser_Azure_Update_DefaultLanguage (23.65s)
=== RUN TestAccUser_Azure_Update_Roles
--- PASS: TestAccUser_Azure_Update_Roles (41.88s)
PASS
ok github.com/betr-io/terraform-provider-mssql/mssql 725.730s

@jc-eso
Copy link

jc-eso commented Sep 23, 2024

@magne Is this repo/provider still being maintained/will this PR be reviewed and or merged? I currently use the mssql_user resource on the parent provider and am interested in using the database_permission resource that this PR implements but would like to know if we should continue to use this provider or switch to using the fork from @ValeruS

@maksagit
Copy link

I'm interested in that question too

@maksagit
Copy link

@magne Can you merge this into your main git branch?

@waylew-abc
Copy link

please for the love of peat can someone merge this in ;)

@validis-ad
Copy link

@magne I appreciate your provider is effectively in maintenance mode at the moment, but it's the de-facto one which is returned when people search for the capabilities covered (mostly) by the provider as it stands.

Given this PR (and full disclosure, I'm the one who asked @ValeruS to raise this so that we can keep the community consistently on one project) adds to the feature set, is is feasible that this will be approved/merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants