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

documentation - backup_vault_aws - Fix length validation error handling for vault_name parameter #26127

Closed
wants to merge 1 commit into from

Conversation

PhilippeGalvan
Copy link
Contributor

@PhilippeGalvan PhilippeGalvan commented Aug 4, 2022

Hello!

Usecase:
in backup_aws_vault, if you set the variable vault_name with a string of more than 50 characters, instead of a length error, it raises:
"must consist of lowercase letters, numbers, and hyphens."

I think it should raise something along the line of:
expected length of name to be in the range (1 - 50)

I think this regex is to blame (the last part of the regex):
^[a-zA-Z0-9\-\_\.]{1, 50}$

Proposed solution:
Split the validation into syntax validation and length validation

PS: I might edit this PR later on to comply with guidelines (meanwhile I let this PR in draft).

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" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Output from acceptance testing:

$ make testacc TESTS=TestAccXXX PKG=ec2

...

Hello!

Usecase:
in `backup_aws_vault`, if you set the variable `vault_name` with a string of more than 50 characters, instead of a length error, it raises:
`"must consist of lowercase letters, numbers, and hyphens."`

I think it should raise something along the line of:
`expected length of name to be in the range (1 - 50)`

I think this regex is to blame (the last part of the regex):
`^[a-zA-Z0-9\-\_\.]{1, 50}$`

Proposed solution:
Split the validation into syntax validation and length validation
@github-actions github-actions bot added service/backup Issues and PRs that pertain to the backup service. needs-triage Waiting for first response or review from a maintainer. size/XS Managed by automation to categorize the size of a PR. labels Aug 4, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @PhilippeGalvan 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@PhilippeGalvan PhilippeGalvan changed the title backup_vault_aws - Update length validation error handling for vault_name parameter documentation - backup_vault_aws - Fix length validation error handling for vault_name parameter Aug 8, 2022
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Aug 10, 2022
@ewbankkit
Copy link
Contributor

@PhilippeGalvan Thanks for the contribution 🎉 👏.
I have cherry picked your commit into #26199.

@ewbankkit ewbankkit closed this Aug 10, 2022
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/backup Issues and PRs that pertain to the backup service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants