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: support update of description for project api key resource #1354

Merged
merged 4 commits into from
Jul 28, 2023

Conversation

AgustinBettati
Copy link
Member

Description

Ticket: INTMDB-917

Updating description of an api key in the mongodbatlas_project_api_key resource was not contemplated in update. This includes a new request for handling this scenario.

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contribution guidelines
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code

Further comments

  • Found that api_project_api_key documentation had some inconsistencies, took the opportunity to adjust them here.

@AgustinBettati AgustinBettati requested a review from a team as a code owner July 28, 2023 08:05
@AgustinBettati AgustinBettati changed the title Intmdb 917 fix: support update of description for project api key resource Jul 28, 2023
The following are valid roles:
* `GROUP_OWNER`
* `GROUP_READ_ONLY`
* `GROUP_DATA_ACCESS_ADMIN`
* `GROUP_DATA_ACCESS_READ_WRITE`
* `GROUP_DATA_ACCESS_READ_ONLY`
* `GROUP_CLUSTER_MANAGER`
*
### Programmatic API Keys
Copy link
Member Author

Choose a reason for hiding this comment

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

This section is unrelated to project api key resource, seems like a copy paste that came from project resource documentation

Project Assignment attribute is optional (Use project_assignment going forward as role_names parameter above is deprecated)

* `project_id` - (Required) Project ID to assign to Access Key
* `role_names` - Name of the role. This resource returns all the roles the user has in Atlas.
* `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.
Copy link
Member Author

Choose a reason for hiding this comment

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

role_names is marked as required in our schema, and also verified that an empty array causes project assignment to not be created.

Copy link
Collaborator

@andreaangiolillo andreaangiolillo left a comment

Choose a reason for hiding this comment

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

LGTM. My comments are not blocking the PR. Great work!

website/docs/r/project_api_key.html.markdown Outdated Show resolved Hide resolved
mongodbatlas/resource_mongodbatlas_project_api_key.go Outdated Show resolved Hide resolved
@AgustinBettati
Copy link
Member Author

Hello @pierwill @zach-carr @jwilliams-mongo! I will be merging this PR, but feel free to review and if you have any comments I can address them in a separate PR.

@AgustinBettati AgustinBettati merged commit 86bd40c into master Jul 28, 2023
18 checks passed
@AgustinBettati AgustinBettati deleted the INTMDB-917 branch July 28, 2023 12:37
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