Skip to content

Commit

Permalink
Revert " add support for IAM Group authentication to google_sql_user (#…
Browse files Browse the repository at this point in the history
…9578)" (#9595) (#16726)

This reverts commit 05c4410.
[upstream:ec7eec622d9aefb7c3d490dc9c3df02209cd8ea0]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored and SarahFrench committed Dec 8, 2023
1 parent a95e84a commit eff923c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 35 deletions.
3 changes: 3 additions & 0 deletions .changelog/9595.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
6 changes: 2 additions & 4 deletions google/services/sql/resource_sql_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,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 google/services/sql/resource_sql_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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 @@ -37,7 +36,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 @@ -315,15 +313,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 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 eff923c

Please sign in to comment.