Skip to content

Commit

Permalink
Update sql_user type (#10835) (#18452)
Browse files Browse the repository at this point in the history
[upstream:808def1f5573d57add94260a6000315c3ce2c58d]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician committed Jun 17, 2024
1 parent 88594bb commit 75bca58
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .changelog/10835.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
sql: added support for more MySQL values in `google_sql_user.type`
```
5 changes: 2 additions & 3 deletions google/services/sql/resource_sql_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func ResourceSqlUser() *schema.Resource {
Optional: true,
Sensitive: true,
Description: `The password for the user. Can be updated. For Postgres instances this is a Required field, unless type is set to
either CLOUD_IAM_USER or CLOUD_IAM_SERVICE_ACCOUNT.`,
either CLOUD_IAM_USER or CLOUD_IAM_SERVICE_ACCOUNT.`,
},

"type": {
Expand All @@ -104,8 +104,7 @@ func ResourceSqlUser() *schema.Resource {
ForceNew: true,
DiffSuppressFunc: tpgresource.EmptyOrDefaultStringSuppress("BUILT_IN"),
Description: `The user type. It determines the method to authenticate the user during login.
The default is the database's built-in user type. Flags include "BUILT_IN", "CLOUD_IAM_USER", "CLOUD_IAM_GROUP" or "CLOUD_IAM_SERVICE_ACCOUNT".`,
ValidateFunc: validation.StringInSlice([]string{"BUILT_IN", "CLOUD_IAM_USER", "CLOUD_IAM_GROUP", "CLOUD_IAM_SERVICE_ACCOUNT", ""}, false),
The default is the database's built-in user type.`,
},
"sql_server_user_details": {
Type: schema.TypeList,
Expand Down
4 changes: 3 additions & 1 deletion website/docs/r/sql_user.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ The following arguments are supported:

* `type` - (Optional) The user type. It determines the method to authenticate the
user during login. The default is the database's built-in user type. Flags
include "BUILT_IN", "CLOUD_IAM_USER", "CLOUD_IAM_GROUP" or "CLOUD_IAM_SERVICE_ACCOUNT".
include "BUILT_IN", "CLOUD_IAM_USER", and "CLOUD_IAM_SERVICE_ACCOUNT" for both
[Postgres](https://cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/users#sqlusertype) and [MySQL](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/users#sqlusertype).
MySQL also includes "CLOUD_IAM_GROUP", "CLOUD_IAM_GROUP_USER" and "CLOUD_IAM_GROUP_SERVICE_ACCOUNT".

* `deletion_policy` - (Optional) The deletion policy for the user.
Setting `ABANDON` allows the resource to be abandoned rather than deleted. This is useful
Expand Down

0 comments on commit 75bca58

Please sign in to comment.