Skip to content

Commit 6379775

Browse files
docs: cleanup in project_api_key docs, and unused code in resource (#1636)
1 parent 16bcebd commit 6379775

File tree

3 files changed

+0
-20
lines changed

3 files changed

+0
-20
lines changed

mongodbatlas/resource_mongodbatlas_project_api_key.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,6 @@ func resourceMongoDBAtlasProjectAPIKeyUpdate(ctx context.Context, d *schema.Reso
191191
projectID := ids["project_id"]
192192
apiKeyID := ids["api_key_id"]
193193

194-
updateRequest := new(matlas.AssignAPIKey)
195-
if d.HasChange("role_names") {
196-
updateRequest.Roles = expandStringList(d.Get("role_names").(*schema.Set).List())
197-
if updateRequest.Roles != nil {
198-
_, err := conn.ProjectAPIKeys.Assign(ctx, projectID, apiKeyID, updateRequest)
199-
if err != nil {
200-
return diag.FromErr(fmt.Errorf("error updating API key: %s", err))
201-
}
202-
}
203-
}
204-
205194
if d.HasChange("project_assignment") {
206195
// Getting the current api_keys and the new api_keys with changes
207196
newAPIKeys, changedAPIKeys, removedAPIKeys := getStateProjectAssignmentAPIKeys(d)

website/docs/d/project_api_key.html.markdown

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,13 @@ description: |-
1919
### Using org_id attribute to query
2020
```terraform
2121
resource "mongodbatlas_project_api_key" "test" {
22-
description = "Description of the API key"
23-
project_id = "32b6e34b3d91647abb20e7b8"
2422
description = "Description of the API key"
2523
project_id = "32b6e34b3d91647abb20e7b8"
2624
role_names = ["GROUP_READ_ONLY"]
2725
}
2826
}
2927
3028
data "mongodbatlas_project_api_key" "test" {
31-
project_id = "${mongodbatlas_api_key.test.project_id}"
3229
api_key_id = "${mongodbatlas_api_key.test.api_key_id}"
3330
}
3431
```

website/docs/r/project_api_key.html.markdown

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,13 @@ resource "mongodbatlas_project_api_key" "test" {
3131
resource "mongodbatlas_project_api_key" "test" {
3232
description = "Description of your API key"
3333
project_id = "64259ee860c43338194b0f8e"
34-
description = "Description of your API key"
35-
project_id = "64259ee860c43338194b0f8e"
3634
3735
project_assignment {
38-
project_id = "64259ee860c43338194b0f8e"
3936
project_id = "64259ee860c43338194b0f8e"
4037
role_names = ["GROUP_READ_ONLY", "GROUP_OWNER"]
4138
}
4239
4340
project_assignment {
44-
project_id = "74259ee860c43338194b0f8e"
4541
project_id = "74259ee860c43338194b0f8e"
4642
role_names = ["GROUP_READ_ONLY"]
4743
}
@@ -58,7 +54,6 @@ resource "mongodbatlas_project_api_key" "test" {
5854

5955
### project_assignment
6056
List of Project roles that the Programmatic API key needs to have. `project_assignment` attribute is optional.
61-
List of Project roles that the Programmatic API key needs to have. `project_assignment` attribute is optional.
6257

6358
* `project_id` - (Required) Project ID to assign to Access Key
6459
* `role_names` - (Required) List of Project roles that the Programmatic API key needs to have. Ensure you provide: at least one role and ensure all roles are valid for the Project. You must specify an array even if you are only associating a single role with the Programmatic API key. The [MongoDB Documentation](https://www.mongodb.com/docs/atlas/reference/user-roles/#project-roles) describes the valid roles that can be assigned.
@@ -77,4 +72,3 @@ API Keys must be imported using project ID, API Key ID e.g.
7772
$ terraform import mongodbatlas_project_api_key.test 5d09d6a59ccf6445652a444a-6576974933969669
7873
```
7974
See [MongoDB Atlas API - API Key](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Programmatic-API-Keys/operation/createProjectApiKey) - Documentation for more information.
80-
See [MongoDB Atlas API - API Key](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Programmatic-API-Keys/operation/createProjectApiKey) - Documentation for more information.

0 commit comments

Comments
 (0)