bedrock list-foundation-models: --by-provider rejects valid provider names containing "." (e.g. "Z.AI")
- Dominant language
- Python
- Stars
- 17.3k
- Forks
- 4.6k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 13
Description
### Describe the bug
`aws bedrock list-foundation-models --by-provider` rejects provider names that contain a period, even though the Bedrock API itself returns such provider names. For example, `Z.AI` is a valid `providerName` in the response, but it cannot be used as a `--by-provider` filter value.
The `byProvider` input is validated against the regex `[A-Za-z0-9- ]{1,63}`, which does not permit `.`. This is stricter than the set of provider names the service actually emits, so any provider whose name contains a dot cannot be filtered server-side.
### Steps to reproduce
```
$ aws bedrock list-foundation-models --region us-east-1 --by-provider "Z.AI"
An error occurred (ValidationException) when calling the ListFoundationModels operation: 1 validation error detected: Value at 'byProvider' failed to satisfy constraint: Member must satisfy regular expression pattern: [A-Za-z0-9- ]{1,63}
```
Yet the service returns models with exactly this provider name:
```
$ aws bedrock list-foundation-models --region us-east-1 --query "modelSummaries[?providerName=='Z.AI'].[modelId,providerName]"
[
[ "zai.glm-4.7-flash", "Z.AI" ],
[ "zai.glm-4.7", "Z.AI" ],
[ "zai.glm-5", "Z.AI" ]
]
```
### Expected behavior
`--by-provider "Z.AI"` should return the Z.AI models, since `Z.AI` is a provider name the API returns. The `byProvider` validation pattern should accept any value the service can emit as a `providerName` (i.e. allow `.`).
### Workaround
Filter client-side with `--query` instead of the server-side `--by-provider` flag:
```
aws bedrock list-foundation-models --region us-east-1 --query "modelSummaries[?providerName=='Z.AI']"
```
### Note
This likely originates in the Bedrock service API model (the `byProvider` constraint), not the CLI client itself — the CLI simply passes the value through and surfaces the service's `ValidationException`. Filing here per the aws-cli issue process; please route to the Bedrock service team if that's the correct owner.
### Environment
- aws-cli reproduced against `bedrock list-foundation-models`, region `us-east-1`
- Provider affected: `Z.AI` (any provider name containing `.`)
Contributor guide
Assessment
This issue has not been assessed yet.