From 017411b85ce7ac7b1cf3a95e64b0acf19cf362b5 Mon Sep 17 00:00:00 2001 From: Andrew Starr-Bochicchio Date: Tue, 17 Dec 2024 17:42:47 -0500 Subject: [PATCH] fix: add opensearch_acl to data.digitalocean_database_user schema --- digitalocean/database/datasource_database_user.go | 5 +++++ digitalocean/database/datasource_database_user_test.go | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/digitalocean/database/datasource_database_user.go b/digitalocean/database/datasource_database_user.go index e9a4fc015..3c27e6e8b 100644 --- a/digitalocean/database/datasource_database_user.go +++ b/digitalocean/database/datasource_database_user.go @@ -56,6 +56,11 @@ func DataSourceDigitalOceanDatabaseUser() *schema.Resource { Optional: true, Elem: userACLSchema(), }, + "opensearch_acl": { + Type: schema.TypeList, + Optional: true, + Elem: userOpenSearchACLSchema(), + }, }, }, }, diff --git a/digitalocean/database/datasource_database_user_test.go b/digitalocean/database/datasource_database_user_test.go index 81349592c..1f4361630 100644 --- a/digitalocean/database/datasource_database_user_test.go +++ b/digitalocean/database/datasource_database_user_test.go @@ -53,6 +53,11 @@ func TestAccDataSourceDigitalOceanDatabaseUser_Basic(t *testing.T) { "digitalocean_database_user.foobar_user", "access_cert"), resource.TestCheckNoResourceAttr( "digitalocean_database_user.foobar_user", "access_key"), + + resource.TestCheckResourceAttr( + "data.digitalocean_database_user.doadmin", "name", "doadmin"), + resource.TestCheckResourceAttr( + "data.digitalocean_database_user.doadmin", "role", "primary"), ), }, }, @@ -60,6 +65,11 @@ func TestAccDataSourceDigitalOceanDatabaseUser_Basic(t *testing.T) { } const testAccCheckDigitalOceanDatasourceDatabaseUserConfigBasic = ` +data "digitalocean_database_user" "doadmin" { + cluster_id = digitalocean_database_cluster.foobar.id + name = "doadmin" +} + data "digitalocean_database_user" "foobar_user" { cluster_id = digitalocean_database_cluster.foobar.id name = "%s"