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

String validation error text doesn't match regex #20117

Closed
chrismarget opened this issue Jul 9, 2021 · 3 comments · Fixed by #20842
Closed

String validation error text doesn't match regex #20117

chrismarget opened this issue Jul 9, 2021 · 3 comments · Fixed by #20842
Labels
bug Addresses a defect in current functionality. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/imagebuilder Issues and PRs that pertain to the imagebuilder service.
Milestone

Comments

@chrismarget
Copy link

chrismarget commented Jul 9, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform 1.0.1
AWS provider 3.49.0

Affected Resource(s)

aws_imagebuilder_distribution_configuration

Debug Output

When specifying that the imagebuilder distribution config apply a name containing a period to the new AMI, the following error is displayed:

Error: invalid value for distribution.1.ami_distribution_configuration.0.name (must contain only alphanumeric characters, periods, underscores, and hyphens)

Panic Output

n/a

Expected Behavior

The validation regex is correct in that periods do not seem to be permitted by AWS, so the error message should not suggest that periods are permitted in this field.

Actual Behavior

The error text indicates that periods are allowed. They are not permitted by the validation regex, nor apparently, by the AWS API.

Steps to Reproduce

Review the regex here:

validation.StringMatch(regexp.MustCompile(`^[-_A-Za-z0-9{][-_A-Za-z0-9\s:{}]+[-_A-Za-z0-9}]$`), "must contain only alphanumeric characters, periods, underscores, and hyphens"),

Important Factoids

Note that the regex suggested by the AWS documentation link above (^[-_A-Za-z-0-9][-_A-Za-z0-9 ]{1,126}[-_A-Za-z-0-9]$) doesn't seem to be correct because it wouldn't allow inclusion of AWS-side substitutions like {{ imagebuilder:buildDate }}

References

AWS API guide

Error text which needs "periods" removed

@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jul 9, 2021
@gdavison gdavison added the service/imagebuilder Issues and PRs that pertain to the imagebuilder service. label Jul 9, 2021
@breathingdust breathingdust added bug Addresses a defect in current functionality. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 31, 2021
@kamilturek
Copy link
Collaborator

I am going to work on this issue.

@github-actions
Copy link

This functionality has been released in v3.59.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Jun 8, 2022

I'm going to lock this issue 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 similar to this, 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 Jun 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/imagebuilder Issues and PRs that pertain to the imagebuilder service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants