Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update max length for bedrock agent instructions #40279

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

stefanfreitag
Copy link
Contributor

@stefanfreitag stefanfreitag commented Nov 22, 2024

Description

The optional instruction argument of the resource aws_bedrock_agent has a length limitation. In the AWS provider a validation has been put in place to fail-fast on invalid inputs. In the current provider version the allowed range for instruction is 40 - 4000 character.

AWS increased the maximum number of characters to 8000.
This can be verified by checking the default account level quota, e.g. via

❯ aws service-quotas get-service-quota --service-code bedrock --quota-code L-6E3CDA2D --output table

The output of above command is

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|                                                                                                         GetServiceQuota                                                                                                         |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
||                                                                                                             Quota                                                                                                             ||
|+------------+--------------+----------------------+----------------------------------------------------------------------+-------------+-----------------------------------+--------------+-----------------+-------+----------+|
|| Adjustable | GlobalQuota  | QuotaAppliedAtLevel  |                              QuotaArn                                |  QuotaCode  |             QuotaName             | ServiceCode  |   ServiceName   | Unit  |  Value   ||
|+------------+--------------+----------------------+----------------------------------------------------------------------+-------------+-----------------------------------+--------------+-----------------+-------+----------+|
||  True      |  False       |  ACCOUNT             |  arn:aws:servicequotas:eu-central-1:<redacted>:bedrock/L-6E3CDA2D  |  L-6E3CDA2D |  Characters in Agent instructions |  bedrock     |  Amazon Bedrock |  None |  8000.0  ||
|+------------+--------------+----------------------+----------------------------------------------------------------------+-------------+-----------------------------------+--------------+-----------------+-------+----------+|

Relations

References

Output from Acceptance Testing

make testacc TESTS=TestAccBedrockAgentAgent PKG=bedrockagent
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/bedrockagent/... -v -count 1 -parallel 20 -run='TestAccBedrockAgentAgent'  -timeout 360m
2024/11/23 21:40:35 Initializing Terraform AWS Provider...
=== RUN   TestAccBedrockAgentAgentActionGroup_basic
=== PAUSE TestAccBedrockAgentAgentActionGroup_basic
=== RUN   TestAccBedrockAgentAgentActionGroup_upgradeToPrepareAgent
=== PAUSE TestAccBedrockAgentAgentActionGroup_upgradeToPrepareAgent
=== RUN   TestAccBedrockAgentAgentActionGroup_APISchema_s3
=== PAUSE TestAccBedrockAgentAgentActionGroup_APISchema_s3
=== RUN   TestAccBedrockAgentAgentActionGroup_update
=== PAUSE TestAccBedrockAgentAgentActionGroup_update
=== RUN   TestAccBedrockAgentAgentActionGroup_FunctionSchema_memberFunctions
=== PAUSE TestAccBedrockAgentAgentActionGroup_FunctionSchema_memberFunctions
=== RUN   TestAccBedrockAgentAgentActionGroup_ActionGroupExecutor_customControl
=== PAUSE TestAccBedrockAgentAgentActionGroup_ActionGroupExecutor_customControl
=== RUN   TestAccBedrockAgentAgentAlias_basic
=== PAUSE TestAccBedrockAgentAgentAlias_basic
=== RUN   TestAccBedrockAgentAgentAlias_disappears
=== PAUSE TestAccBedrockAgentAgentAlias_disappears
=== RUN   TestAccBedrockAgentAgentAlias_update
=== PAUSE TestAccBedrockAgentAgentAlias_update
=== RUN   TestAccBedrockAgentAgentAlias_routingUpdate
=== PAUSE TestAccBedrockAgentAgentAlias_routingUpdate
=== RUN   TestAccBedrockAgentAgentAlias_tags
=== PAUSE TestAccBedrockAgentAgentAlias_tags
=== RUN   TestAccBedrockAgentAgentAlias_provisionedThroughput
    agent_alias_test.go:227: Bedrock Provisioned Model Throughput for Antropic Claude 2 has a minimum 1 month commitment and costs > $45K/month
--- SKIP: TestAccBedrockAgentAgentAlias_provisionedThroughput (0.00s)
=== RUN   TestAccBedrockAgentAgentKnowledgeBaseAssociation_basic
    agent_knowledge_base_association_test.go:26: File  not found on PATH, skipping test: exec: "psql": executable file not found in $PATH
--- SKIP: TestAccBedrockAgentAgentKnowledgeBaseAssociation_basic (0.00s)
=== RUN   TestAccBedrockAgentAgentKnowledgeBaseAssociation_update
    agent_knowledge_base_association_test.go:76: File  not found on PATH, skipping test: exec: "psql": executable file not found in $PATH
--- SKIP: TestAccBedrockAgentAgentKnowledgeBaseAssociation_update (0.00s)
=== RUN   TestAccBedrockAgentAgentKnowledgeBaseAssociation_disappears
    agent_knowledge_base_association_test.go:134: File  not found on PATH, skipping test: exec: "psql": executable file not found in $PATH
--- SKIP: TestAccBedrockAgentAgentKnowledgeBaseAssociation_disappears (0.00s)
=== RUN   TestAccBedrockAgentAgent_basic
=== PAUSE TestAccBedrockAgentAgent_basic
=== RUN   TestAccBedrockAgentAgent_full
=== PAUSE TestAccBedrockAgentAgent_full
=== RUN   TestAccBedrockAgentAgent_singlePrompt
=== PAUSE TestAccBedrockAgentAgent_singlePrompt
=== RUN   TestAccBedrockAgentAgent_singlePromptUpdate
=== PAUSE TestAccBedrockAgentAgent_singlePromptUpdate
=== RUN   TestAccBedrockAgentAgent_addPrompt
=== PAUSE TestAccBedrockAgentAgent_addPrompt
=== RUN   TestAccBedrockAgentAgent_guardrail
=== PAUSE TestAccBedrockAgentAgent_guardrail
=== RUN   TestAccBedrockAgentAgent_update
=== PAUSE TestAccBedrockAgentAgent_update
=== RUN   TestAccBedrockAgentAgent_tags
=== PAUSE TestAccBedrockAgentAgent_tags
=== RUN   TestAccBedrockAgentAgent_kms
=== PAUSE TestAccBedrockAgentAgent_kms
=== CONT  TestAccBedrockAgentAgentActionGroup_basic
=== CONT  TestAccBedrockAgentAgentAlias_tags
=== CONT  TestAccBedrockAgentAgent_kms
=== CONT  TestAccBedrockAgentAgent_tags
=== CONT  TestAccBedrockAgentAgent_update
=== CONT  TestAccBedrockAgentAgent_guardrail
=== CONT  TestAccBedrockAgentAgent_addPrompt
=== CONT  TestAccBedrockAgentAgent_singlePromptUpdate
=== CONT  TestAccBedrockAgentAgent_singlePrompt
=== CONT  TestAccBedrockAgentAgent_full
=== CONT  TestAccBedrockAgentAgent_basic
=== CONT  TestAccBedrockAgentAgentActionGroup_ActionGroupExecutor_customControl
=== CONT  TestAccBedrockAgentAgentAlias_routingUpdate
=== CONT  TestAccBedrockAgentAgentAlias_update
=== CONT  TestAccBedrockAgentAgentAlias_disappears
=== CONT  TestAccBedrockAgentAgentAlias_basic
=== CONT  TestAccBedrockAgentAgentActionGroup_update
=== CONT  TestAccBedrockAgentAgentActionGroup_FunctionSchema_memberFunctions
=== CONT  TestAccBedrockAgentAgentActionGroup_APISchema_s3
=== CONT  TestAccBedrockAgentAgentActionGroup_upgradeToPrepareAgent
--- PASS: TestAccBedrockAgentAgent_basic (115.57s)
--- PASS: TestAccBedrockAgentAgentAlias_disappears (116.28s)
--- PASS: TestAccBedrockAgentAgent_full (117.58s)
--- PASS: TestAccBedrockAgentAgent_singlePrompt (127.22s)
--- PASS: TestAccBedrockAgentAgentActionGroup_FunctionSchema_memberFunctions (128.47s)
--- PASS: TestAccBedrockAgentAgentActionGroup_basic (129.47s)
--- PASS: TestAccBedrockAgentAgentAlias_basic (131.74s)
--- PASS: TestAccBedrockAgentAgentActionGroup_ActionGroupExecutor_customControl (151.14s)
--- PASS: TestAccBedrockAgentAgentActionGroup_APISchema_s3 (151.28s)
--- PASS: TestAccBedrockAgentAgent_singlePromptUpdate (161.87s)
--- PASS: TestAccBedrockAgentAgent_kms (164.07s)
--- PASS: TestAccBedrockAgentAgentActionGroup_upgradeToPrepareAgent (164.38s)
--- PASS: TestAccBedrockAgentAgentAlias_update (172.22s)
--- PASS: TestAccBedrockAgentAgentAlias_routingUpdate (182.45s)
--- PASS: TestAccBedrockAgentAgentActionGroup_update (190.69s)
--- PASS: TestAccBedrockAgentAgent_tags (192.68s)
--- PASS: TestAccBedrockAgentAgent_update (194.83s)
--- PASS: TestAccBedrockAgentAgentAlias_tags (199.70s)
--- PASS: TestAccBedrockAgentAgent_guardrail (213.78s)
--- PASS: TestAccBedrockAgentAgent_addPrompt (225.44s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagent       225.700s

Increase the maximum number of characters from 4000 to 8000.
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. service/bedrockagent Issues and PRs that pertain to the bedrockagent service. needs-triage Waiting for first response or review from a maintainer. labels Nov 22, 2024
@stefanfreitag stefanfreitag marked this pull request as ready for review November 23, 2024 21:05
@stefanfreitag stefanfreitag requested a review from a team as a code owner November 23, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. needs-triage Waiting for first response or review from a maintainer. service/bedrockagent Issues and PRs that pertain to the bedrockagent service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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