Skip to content

Add support for roles to both rate limit and lease count quotas - #1994

Merged
raskchanky merged 10 commits into
mainfrom
vault-14105
Aug 31, 2023
Merged

Add support for roles to both rate limit and lease count quotas#1994
raskchanky merged 10 commits into
mainfrom
vault-14105

Conversation

@raskchanky

Copy link
Copy Markdown
Contributor

This adds support for the role attribute for both rate limit and lease count quotas.

Closes #1782

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Release note for CHANGELOG:

Add support for the `role` attribute for both rate limit and lease count quotas

Output from acceptance testing:

~/s/h/terraform-provider-vault ❯❯❯ (vault-14105) env TF_ACC=1 VAULT_TOKEN=root VAULT_ADDR=http://127.0.0.1:8200 go test -v -count=1 -run="^TestQuotaRateLimitWithRole\$" ./vault
2023/08/29 16:08:26 [INFO] Using Vault token with the following policies: root
=== RUN   TestQuotaRateLimitWithRole
--- PASS: TestQuotaRateLimitWithRole (0.80s)
PASS
ok      github.com/hashicorp/terraform-provider-vault/vault     1.336s
~/s/h/terraform-provider-vault ❯❯❯ (vault-14105) env TF_ACC=1 TF_ACC_ENTERPRISE=1 VAULT_TOKEN=root VAULT_ADDR=http://127.0.0.1:8200 go test -v -count=1 -run="^TestQuotaLeaseCountWithRole\$" ./vault
2023/08/29 16:08:38 [INFO] Using Vault token with the following policies: root
=== RUN   TestQuotaLeaseCountWithRole
--- PASS: TestQuotaLeaseCountWithRole (1.21s)
PASS
ok      github.com/hashicorp/terraform-provider-vault/vault     1.617s
~/s/h/terraform-provider-vault ❯❯❯ (vault-14105)

@raskchanky

Copy link
Copy Markdown
Contributor Author

This is my first PR to this repo so if I did something wrong here, please let me know 😅

Comment thread vault/resource_quota_lease_count_test.go
Comment thread vault/resource_quota_lease_count_test.go
Comment thread vault/resource_quota_lease_count.go Outdated

@fairclothjm fairclothjm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looking good @raskchanky ! Thanks! Just a few comments

@raskchanky
raskchanky requested a review from fairclothjm August 30, 2023 17:19

@fairclothjm fairclothjm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Thanks!

@fairclothjm fairclothjm modified the milestones: 3.20.0, Future, 3.21.0 Aug 30, 2023
Comment thread vault/resource_quota_lease_count_test.go

@fairclothjm fairclothjm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I forgot to mention the Import test step the last time around. Sorry about that! Otherwise LGTM! Thanks!

Comment thread vault/resource_quota_rate_limit_test.go Outdated
Comment thread vault/resource_quota_lease_count_test.go Outdated

@vinay-gopalan vinay-gopalan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for working through this! Apologies for the longer comments, these are definitely more nuanced bits of the TFVP so wanted to take a sec to be more descriptive! Happy to answer any more questions if needed :)

Comment thread vault/resource_quota_lease_count.go Outdated
Comment thread vault/resource_quota_lease_count.go Outdated
Comment thread vault/resource_quota_lease_count.go Outdated
Comment thread vault/resource_quota_lease_count_test.go Outdated
@raskchanky

Copy link
Copy Markdown
Contributor Author

@vinay-gopalan Thank you so much for all the comments! Never apologize for too much information. This is terrific stuff, particularly for someone like me that's so new to this code. I appreciate all the time you took to write all this up.

@raskchanky

Copy link
Copy Markdown
Contributor Author

@vinay-gopalan @fairclothjm Anything else to do here or is this good to merge?

@fairclothjm fairclothjm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@raskchanky
raskchanky merged commit e78540a into main Aug 31, 2023
@raskchanky
raskchanky deleted the vault-14105 branch August 31, 2023 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add support for the role parameter in vault_quota_rate_limit

3 participants