[Bug]: aws_bedrock_foundation_models data source has incorrect regex validation for by_provider #37305
Labels
bug
Addresses a defect in current functionality.
service/bedrock
Issues and PRs that pertain to the bedrock service.
Milestone
Terraform Core Version
1.4.7
AWS Provider Version
5.48.0
Affected Resource(s)
The
aws_bedrock_foundation_models
data source has an attributeby_provider
that has an incorrect regex validator.Expected Behavior
I am able to search by provider names with upper case letters and spaces - the provider
Mistral AI
fits this description. This is permitted by the AWS ListFoundationalModels API, which lists a validation pattern of^[A-Za-z0-9- ]{1,63}$
.Actual Behavior
The validator reports an error with an incorrect regex requirement
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
Run
terraform validate
with the above code snippet.Mistral AI
is a valid provider name (and one of the providers returned by the data source when you search with no filters), but there is no way of specifying this provider.Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
AWS API Reference: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_ListFoundationModels.html
Would you like to implement a fix?
Yes
The text was updated successfully, but these errors were encountered: