From 6923c99b621c4ee4f951164fdb71b516f90d9771 Mon Sep 17 00:00:00 2001 From: Wilson de Carvalho <796900+wcmjunior@users.noreply.github.com> Date: Tue, 13 Feb 2024 16:27:11 -0800 Subject: [PATCH] Add missing mongodb flavor configuration --- .../internal/repository/data_source_cyral_repository.go | 9 +++++++-- .../repository/resource_cyral_repository_test.go | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cyral/internal/repository/data_source_cyral_repository.go b/cyral/internal/repository/data_source_cyral_repository.go index 348872bc..d6a25138 100644 --- a/cyral/internal/repository/data_source_cyral_repository.go +++ b/cyral/internal/repository/data_source_cyral_repository.go @@ -179,12 +179,17 @@ func DataSourceRepository() *schema.Resource { Computed: true, }, RepoMongoDBServerTypeKey: { - Description: "Type of the MongoDB server. Allowed values: " + utils.SupportedValuesAsMarkdown(mongoServerTypes()), + Description: "Type of the MongoDB server.", Type: schema.TypeString, Computed: true, }, RepoMongoDBSRVRecordName: { - Description: "Name of a DNS SRV record which contains cluster topology details", + Description: "Name of a DNS SRV record which contains cluster topology details.", + Type: schema.TypeString, + Optional: true, + }, + RepoMongoDBFlavorKey: { + Description: "The flavor of the MongoDB deployment.", Type: schema.TypeString, Optional: true, }, diff --git a/cyral/internal/repository/resource_cyral_repository_test.go b/cyral/internal/repository/resource_cyral_repository_test.go index 5ce9a2e7..1d91d02f 100644 --- a/cyral/internal/repository/resource_cyral_repository_test.go +++ b/cyral/internal/repository/resource_cyral_repository_test.go @@ -280,6 +280,7 @@ func repoAsConfig(repo repository.RepoInfo, resName string) string { replicaSet := "null" serverType := "null" srvRecordName := "null" + flavor := "null" if repo.MongoDBSettings.ReplicaSetName != "" { replicaSet = fmt.Sprintf(`"%s"`, repo.MongoDBSettings.ReplicaSetName) } @@ -289,15 +290,20 @@ func repoAsConfig(repo repository.RepoInfo, resName string) string { if repo.MongoDBSettings.SRVRecordName != "" { srvRecordName = fmt.Sprintf(`"%s"`, repo.MongoDBSettings.SRVRecordName) } + if repo.MongoDBSettings.Flavor != "" { + flavor = fmt.Sprintf(`"%s"`, repo.MongoDBSettings.Flavor) + } config += fmt.Sprintf(` mongodb_settings { replica_set_name = %s server_type = %s srv_record_name = %s + flavor = %s }`, replicaSet, serverType, srvRecordName, + flavor, ) }