Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MongoDB and Redis user provider #283

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

lpatte
Copy link
Contributor

@lpatte lpatte commented Aug 9, 2022

  • MongoDB User Lifecycle
  • Redis User Lifecycle
  • Import Test for Cloud Databases resources
  • Fix Database User Resource Import
  • Add ForceNew in Database Resource
  • add Retry in IP restriction to work with MongoDB
  • Use ValidateFunc for Database User engine input instead custom validation process

@lpatte lpatte force-pushed the PUD-1392-1389_redis-mongo-user-provider branch from 2901e92 to f6e7408 Compare August 9, 2022 14:04
@lpatte
Copy link
Contributor Author

lpatte commented Aug 9, 2022

@ovh/cloud-databases please review

@lpatte lpatte force-pushed the PUD-1392-1389_redis-mongo-user-provider branch from f6e7408 to 41d60e8 Compare August 10, 2022 10:36
@lpatte lpatte force-pushed the PUD-1392-1389_redis-mongo-user-provider branch 4 times, most recently from a7f5cfb to 715fd77 Compare August 11, 2022 15:55
@lpatte lpatte requested a review from BellionBastien August 11, 2022 15:56
@lpatte lpatte force-pushed the PUD-1392-1389_redis-mongo-user-provider branch from 715fd77 to 87b45cf Compare August 12, 2022 09:56
@scraly
Copy link
Collaborator

scraly commented Aug 19, 2022

review in progress

one modification to do in the doc please:

resource "ovh_cloud_project_database" "mongodb" {
  service_name = var.openstack_infos.project_id
resource "ovh_cloud_project_database" "mongodb" {
 service_name = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

:)

Get information about a user of a mongodb cluster associated with a public cloud project.
---

# cloud_project_database_mongodb_user (Data Source)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# cloud_project_database_mongodb_user (Data Source)
# ovh_cloud_project_database_mongodb_user (Data Source)

Get information about a user of a redis cluster associated with a public cloud project.
---

# cloud_project_database_redis_user (Data Source)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# cloud_project_database_redis_user (Data Source)
# ovh_cloud_project_database_redis_user (Data Source)

Creates an user for a mongodb cluster associated with a public cloud project.
---

# cloud_project_database_mongodb_user
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# cloud_project_database_mongodb_user
# ovh_cloud_project_database_mongodb_user

Creates an user for a redis cluster associated with a public cloud project.
---

# cloud_project_database_redis_user
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# cloud_project_database_redis_user
# ovh_cloud_project_database_redis_user

data "ovh_cloud_project_database_mongodb_user" "mongouser" {
service_name = "XXX"
cluster_id = "YYY"
username = "ZZZ"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
username = "ZZZ"
name = "ZZZ@admin"

* `name` - See Argument Reference above.
* `password` - Password of the user.
* `roles` - See Argument Reference above.
* `roles_auth_db` - Roles the user belongs to with the authentication database in the format role@authDB
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not exists anymore?

The following attributes are exported:

* `categories` - Categories of the user.
* `channels` - Channels of the user.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `channels` - Channels of the user.
* `channels` - Channels of the user.
* `cluster_id` - ID of the cluster.


func TestAccCloudProjectDatabaseMongodbUserDataSource_basic(t *testing.T) {
serviceName := os.Getenv("OVH_CLOUD_PROJECT_SERVICE_TEST")
version := os.Getenv("OVH_CLOUD_PROJECT_DATABASE_POSTGRESQL_VERSION_TEST")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version := os.Getenv("OVH_CLOUD_PROJECT_DATABASE_POSTGRESQL_VERSION_TEST")
version := os.Getenv("OVH_CLOUD_PROJECT_DATABASE_MONGODB_VERSION_TEST")


func TestAccCloudProjectDatabaseRedisUserDataSource_basic(t *testing.T) {
serviceName := os.Getenv("OVH_CLOUD_PROJECT_SERVICE_TEST")
version := os.Getenv("OVH_CLOUD_PROJECT_DATABASE_POSTGRESQL_VERSION_TEST")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version := os.Getenv("OVH_CLOUD_PROJECT_DATABASE_POSTGRESQL_VERSION_TEST")
version := os.Getenv("OVH_CLOUD_PROJECT_DATABASE_REDIS_VERSION_TEST")


func TestAccCloudProjectDatabaseRedisUser_importBasic(t *testing.T) {
serviceName := os.Getenv("OVH_CLOUD_PROJECT_SERVICE_TEST")
version := os.Getenv("OVH_CLOUD_PROJECT_DATABASE_POSTGRESQL_VERSION_TEST")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version := os.Getenv("OVH_CLOUD_PROJECT_DATABASE_POSTGRESQL_VERSION_TEST")
version := os.Getenv("OVH_CLOUD_PROJECT_DATABASE_REDIS_VERSION_TEST")

@scraly scraly added the v0.20 label Aug 19, 2022
@lpatte lpatte force-pushed the PUD-1392-1389_redis-mongo-user-provider branch from 87b45cf to 5ae3e4c Compare August 22, 2022 14:56
@lpatte lpatte requested a review from scraly August 23, 2022 08:01
@scraly
Copy link
Collaborator

scraly commented Aug 23, 2022

Thanks, it's OK for me :)

@scraly scraly merged commit e1fb3cb into ovh:master Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants