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

fix(mongodb_user): Fix MongoDb users import and minor errors #485

Merged
merged 8 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions docs/data-sources/mongodb_users.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ user_list = {

The following arguments are required:

* `id` - (Required) MongoDB Users number. Either `id` or `mongodb_instance_no` must be provided.
* `mongodb_instance_no` - (Required) MongoDB Instance No, either `id` or `mongodb_instance_no` must be provided.
* `id` - (Required) MongoDB instance number.
* `output_file` - (Optional) The name of file that can save data source after running `terraform plan`.
* `filter` - (Optional) Custom filter block as described below.
* `name` - (Required) The name of the field to filter by
Expand All @@ -54,6 +53,5 @@ This data source exports the following attributes in addition to the argument ab

* `mongodb_user_list` - The list of users to add.
* `name` - MongoDB User ID.
* `password` - MongoDB User Password.
* `database_name` - MongoDB Database Name that MongoDB User belongs to.
* `authority` - Mongodb User Authority.
* `authority` - Mongodb User Authority.
18 changes: 7 additions & 11 deletions docs/resources/mongodb_users.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ subcategory: "MongoDB"

# Resource: ncloud_mongodb_users

Provides a MongoDB User list resources.
Provides a MongoDB User set resources.

~> **NOTE:** This resource only supports VPC environment.

Expand Down Expand Up @@ -34,8 +34,8 @@ resource "ncloud_mongodb" "mongodb" {
}

resource "ncloud_mongodb_users" "mongodb_users" {
mongodb_instance_no = ncloud_mongodb.mongodb.id
mongodb_user_list = [
id = ncloud_mongodb.mongodb.id
mongodb_user_set = [
{
name = "testuser1",
password = "t123456789!",
Expand All @@ -53,20 +53,16 @@ resource "ncloud_mongodb_users" "mongodb_users" {
```

## Argument Reference

The following arguments are supported:

* `mongodb_instance_no` - (Required) The ID of the associated MongoDB Instance.
* `mongodb_user_list` - The list of users to add.
* `id` - (Required) The ID of the associated MongoDB Instance.
* `mongodb_user_set` - The set of users to add.
* `name` - (Required) MongoDB User ID. Allows only alphabets, numbers and underbar (_). Must start with an alphabetic character. Min: 4, Max: 16
* `password` - (Required) MongoDB User Password. At least one English alphabet, number and special character must be included. Certain special characters ( ` & + \ " ' / space ) cannot be used. Min: 8 , Max: 20
* `database_name` - (Required) MongoDB Database Name to add MongoDB User. Allows only alphabets, numbers and underbar (_). Must start with an alphabetic character. Min: 4 , Max: 30
* `authority` - (Required) MongoDB User Authority. You can select `READ|READ_WRITE`.

## Attribute Reference
In addition to all arguments above, the following attributes are exported

* `id` - MongoDB User list number. (MongoDB Instance number)

## Import

### `terraform import` command
Expand All @@ -86,4 +82,4 @@ import {
to = ncloud_mongodb_users.rsc_name
id = "12345"
}
```
```
Loading
Loading