-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add new 'mssql_role' resource to manipulate role of a SQL Server. #51
base: master
Are you sure you want to change the base?
Add new 'mssql_role' resource to manipulate role of a SQL Server. #51
Conversation
Added newline at end of fedauth main.tf
docs/resources/role.md
Outdated
The following arguments are supported: | ||
|
||
* `server` - (Required) Server and login details for the SQL Server. The attributes supported in the `server` block is detailed below. | ||
* `role_name` - (Required) The name of the roler. Changing this resource property modifies the existing resource. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `role_name` - (Required) The name of the roler. Changing this resource property modifies the existing resource. | |
* `role_name` - (Required) The name of the role. Changing this resource property modifies the existing resource. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
|
||
func (c *Connector) CreateRole(ctx context.Context, database, roleName string) error { | ||
cmd := `DECLARE @sql nvarchar(max); | ||
SET @sql = 'CREATE ROLE ' + QuoteName(@roleName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think one potential improvement here could be to also support authorization. But that can probably be added in another PR:
CREATE ROLE role_name [ AUTHORIZATION owner_name ]
@@ -24,3 +24,12 @@ variable "local_ip_addresses" { | |||
description = "The external IP addresses of the machines running the acceptance tests. This is necessary to allow access to the Azure SQL Server resource." | |||
type = list(string) | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is odd, you need this variable only to run the local tests, where the sql server is started in the Docker container. Is there no better fix for this?
Hi - Is there any chance this will be merged and pushed to the TF registry? We are having a need for this functionality at work as well. :-) Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- All the import acceptance tests (TestAccLogin_Local_BasicImport, Test_resourceRoleImport, and TestAccUser_Local_Import) fail.
- The PR should be merged with master to bring it up to date.
Hello, I hope this PR finds you well.
The objective of this PR is primarily to add a new resource mssql_role for manipulating SQL Server Roles.
Other changes include
Note: I've tried to run the acceptance tests against Azure AD with no success. Further attempts are ongoing but the issue is likely related to Azure Firewall rules. Acceptance tests pass locally. I can provide an update here if progress is made.
If none is possible, can the acceptance tests be ran + verified by an existing pipeline or by a maintainer?
PS. The changelog needs to be updated with the diff link for the proposed minor verson bump when it's available.
Many thanks