String validation error text doesn't match regex #20117
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
Community Note
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:
terraform-provider-aws/aws/resource_aws_imagebuilder_distribution_configuration.go
Line 97 in bae3b38
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
The text was updated successfully, but these errors were encountered: