Skip to content

Commit

Permalink
Revert " add support for IAM Group authentication to google_sql_user (G…
Browse files Browse the repository at this point in the history
  • Loading branch information
NickElliot authored and trodge committed Dec 8, 2023
1 parent eb5ef72 commit 36c3304
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 35 deletions.
6 changes: 2 additions & 4 deletions mmv1/third_party/terraform/services/sql/resource_sql_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,8 @@ 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_SERVICE_ACCOUNT",
"CLOUD_IAM_GROUP", "CLOUD_IAM_GROUP_USER" or "CLOUD_IAM_GROUP_SERVICE_ACCOUNT".`,
ValidateFunc: validation.StringInSlice([]string{"BUILT_IN", "CLOUD_IAM_USER", "CLOUD_IAM_SERVICE_ACCOUNT",
"CLOUD_IAM_GROUP", "CLOUD_IAM_GROUP_USER", "CLOUD_IAM_GROUP_SERVICE_ACCOUNT", ""}, false),
The default is the database's built-in user type. Flags include "BUILT_IN", "CLOUD_IAM_USER", or "CLOUD_IAM_SERVICE_ACCOUNT".`,
ValidateFunc: validation.StringInSlice([]string{"BUILT_IN", "CLOUD_IAM_USER", "CLOUD_IAM_SERVICE_ACCOUNT", ""}, false),
},
"sql_server_user_details": {
Type: schema.TypeList,
Expand Down
11 changes: 0 additions & 11 deletions mmv1/third_party/terraform/services/sql/resource_sql_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func TestAccSqlUser_mysql(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckGoogleSqlUserExists(t, "google_sql_user.user1"),
testAccCheckGoogleSqlUserExists(t, "google_sql_user.user2"),
testAccCheckGoogleSqlUserExists(t, "google_sql_user.user3"),
),
},
{
Expand All @@ -35,7 +34,6 @@ func TestAccSqlUser_mysql(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckGoogleSqlUserExists(t, "google_sql_user.user1"),
testAccCheckGoogleSqlUserExists(t, "google_sql_user.user2"),
testAccCheckGoogleSqlUserExists(t, "google_sql_user.user3"),
),
},
{
Expand Down Expand Up @@ -313,15 +311,6 @@ resource "google_sql_user" "user2" {
instance = google_sql_database_instance.instance.name
host = "gmail.com"
password = "hunter2"
type = "CLOUD_IAM_USER"
}
resource "google_sql_user" "user3" {
name = "admin"
instance = google_sql_database_instance.instance.name
host = "gmail.com"
password = "hunter3"
type = "CLOUD_IAM_GROUP"
}
`, instance, password)
}
Expand Down
21 changes: 1 addition & 20 deletions mmv1/third_party/terraform/website/docs/r/sql_user.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,6 @@ resource "google_sql_user" "iam_service_account_user" {
instance = google_sql_database_instance.main.name
type = "CLOUD_IAM_SERVICE_ACCOUNT"
}
resource "google_sql_user" "iam_group" {
name = "[email protected]"
instance = google_sql_database_instance.main.name
type = "CLOUD_IAM_GROUP"
}
resource "google_sql_user" "iam_group_user" {
name = "[email protected]"
instance = google_sql_database_instance.main.name
type = "CLOUD_IAM_GROUP_USER"
}
resource "google_sql_user" "iam_group_service_account_user" {
name = "[email protected]"
instance = google_sql_database_instance.main.name
type = "CLOUD_IAM_GROUP_SERVICE_ACCOUNT"
}
```

## Argument Reference
Expand All @@ -109,8 +91,7 @@ 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_SERVICE_ACCOUNT",
"CLOUD_IAM_GROUP", "CLOUD_IAM_GROUP_USER" or "CLOUD_IAM_GROUP_SERVICE_ACCOUNT".
include "BUILT_IN", "CLOUD_IAM_USER", or "CLOUD_IAM_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 36c3304

Please sign in to comment.