aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

[AWS::Bedrock::Prompt] - [BUG] - maxLength property being passed as a String

Open
#2,464 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

### Name of the resource

Other

### Resource Name

AWS::Bedrock::Prompt

### Issue Description

When the maxLength value is defined as an integer in the CFN template (used a JSON template with no double quotations around the value) the value passed to the Bedrock prompt resource is showing as a String in the Bedrock Console, for example:

```
"question": {
"type": "string",
"description": "Example of a Description",
"maxLength": "300"
},

```
When testing the prompt, the following json schema error is shown:
`The model returned the following errors: tools.0.custom.input_schema: JSON schema is invalid. It must match JSON Schema draft 2020-12 (https://json-schema.org/draft/2020-12). Learn more about tool use at https://docs.claude.com/en/docs/tool-use.`

Manually changing the maxLength values to integers via the console allows the prompt to run successfully.

### Expected Behavior

maxLength value to be passed as an integer to the Bedrock Prompt resource allowing the successful running of the prompt.

### Observed Behavior

If the maxLength value is not manually changed to an integer in the Console, testing of prompt fails with error:
`The model returned the following errors: tools.0.custom.input_schema: JSON schema is invalid. It must match JSON Schema draft 2020-12 (https://json-schema.org/draft/2020-12). Learn more about tool use at https://docs.claude.com/en/docs/tool-use.`

### Test Cases

In CFN template, define the maxLength value as an integer, for example:
"TestBedrockPrompt": {
"Properties": {
...
"Variants": [
{
...
"TemplateConfiguration": {
"Chat": {
...
"ToolConfiguration": {
...
"Tools": [
{
"ToolSpec": {
"Description": "Testing Prompt",
"InputSchema": {
"Json": {
...
"description": "Example description",
"maxLength": 500
},
},

Then test/run the prompt in the Bedrock Console, should receive error "tools.0.custom.input_schema: JSON schema is invalid".

Manually changing the value in the Console:
Locate Tools section in Configurations panel >> Edit the tool's input schema >> Change maxLength values from strings to integers "{"maxLength": "500"} → {"maxLength": 500} >> Save draft and run the prompt (should succeed)

### Other Details

_No response_

Contributor guide

Open the contributing guide

Research direction

No source file or automated test is named. Start by reproducing the supplied CloudFormation JSON with an integer maxLength in AWS::Bedrock::Prompt, inspect the generated Bedrock input schema, and compare it with the console-corrected version. Done means integer maxLength values remain numeric and the prompt runs without the JSON Schema draft 2020-12 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.