Skip to content

[Bug]: aws_bedrockagent_agent "instruction" attribute validator max should be changed from 4000 to 8000 #40236

Closed
@jsermersheim-hv

Description

@jsermersheim-hv

Terraform Core Version

1.6.6

AWS Provider Version

5.76.0

Affected Resource(s)

validation currently throws the following error for instruction lengths greater than 4000. "Attribute instruction string length must be between 40 and 4000, got: 4036"

Amazon increased the agent instruction limit to 8000 characters. The validator needs to be updated.

image

While the above screenshot shows the AWS Service Quota indicating 8000 characters, the AWS API reference documentation seems to lag behind at 4000 characters:

https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgent.html#bedrock-agent_CreateAgent-request-instruction

Here's the specific code block:

https://github.com/acwwat/terraform-provider-aws/blob/main/internal/service/bedrockagent/agent.go#L127-L135

Expected Behavior

The validator should allow up to 8000 characters

Actual Behavior

validation currently throws the following error for instruction lengths greater than 4000. "Attribute instruction string length must be between 40 and 4000, got: 4036"

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_bedrockagent_agent" "this" {
  agent_name = "agent"
  agent_resource_role_arn = "arn:aws:..."
  foundation_model = var.agent_foundation_model
  instruction = "instructions located here with more than 4000 characters"
}

Steps to Reproduce

You just need to check the validator settings in code and compare to AWS documentation https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html#quotas-agents

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/bedrockagentIssues and PRs that pertain to the bedrockagent service.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions