[Enhancement] aws_bedrockagentcore_agent_runtime/aws_bedrockagentcore_gateway: Add authorizer_configuration.custom_jwt_authorizer.custom_claim block#47049
Conversation
Extract the `custom_claim` schema functionality into a function so that it can be shared with gateway.go.
Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
Pull Request Authors
|
ewbankkit
left a comment
There was a problem hiding this comment.
LGTM 🚀.
% AWS_BEDROCK_AGENTCORE_RUNTIME_IMAGE_V1_URI=123456789012.dkr.ecr.us-west-2.amazonaws.com/bedrockagentcore_v1:latest AWS_BEDROCK_AGENTCORE_RUNTIME_IMAGE_V2_URI=123456789012.dkr.ecr.us-west-2.amazonaws.com/bedrockagentcore_v2:latest make testacc TESTARGS='-run=TestAccBedrockAgentCoreAgentRuntime_' PKG=bedrockagentcore ACCTEST_PARALLELISM=4
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 HEAD 🌿...
TF_ACC=1 go1.25.8 test ./internal/service/bedrockagentcore/... -v -count 1 -parallel 4 -run=TestAccBedrockAgentCoreAgentRuntime_ -timeout 360m -vet=off
2026/03/23 08:20:00 Creating Terraform AWS Provider (SDKv2-style)...
2026/03/23 08:20:00 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN TestAccBedrockAgentCoreAgentRuntime_basic
=== PAUSE TestAccBedrockAgentCoreAgentRuntime_basic
=== RUN TestAccBedrockAgentCoreAgentRuntime_disappears
=== PAUSE TestAccBedrockAgentCoreAgentRuntime_disappears
=== RUN TestAccBedrockAgentCoreAgentRuntime_tags
=== PAUSE TestAccBedrockAgentCoreAgentRuntime_tags
=== RUN TestAccBedrockAgentCoreAgentRuntime_description
=== PAUSE TestAccBedrockAgentCoreAgentRuntime_description
=== RUN TestAccBedrockAgentCoreAgentRuntime_environmentVariables
=== PAUSE TestAccBedrockAgentCoreAgentRuntime_environmentVariables
=== RUN TestAccBedrockAgentCoreAgentRuntime_authorizerConfiguration
=== PAUSE TestAccBedrockAgentCoreAgentRuntime_authorizerConfiguration
=== RUN TestAccBedrockAgentCoreAgentRuntime_authorizerConfigurationCustomClaim
=== PAUSE TestAccBedrockAgentCoreAgentRuntime_authorizerConfigurationCustomClaim
=== RUN TestAccBedrockAgentCoreAgentRuntime_protocolConfiguration
=== PAUSE TestAccBedrockAgentCoreAgentRuntime_protocolConfiguration
=== RUN TestAccBedrockAgentCoreAgentRuntime_artifactContainer
=== PAUSE TestAccBedrockAgentCoreAgentRuntime_artifactContainer
=== RUN TestAccBedrockAgentCoreAgentRuntime_artifactCode
agent_runtime_test.go:771: skipping test; environment variable AWS_BEDROCK_AGENTCORE_RUNTIME_CODE_V1_S3_BUCKET must be set
--- SKIP: TestAccBedrockAgentCoreAgentRuntime_artifactCode (0.00s)
=== RUN TestAccBedrockAgentCoreAgentRuntime_artifactTypeChanged
agent_runtime_test.go:878: skipping test; environment variable AWS_BEDROCK_AGENTCORE_RUNTIME_CODE_V1_S3_BUCKET must be set
--- SKIP: TestAccBedrockAgentCoreAgentRuntime_artifactTypeChanged (0.00s)
=== CONT TestAccBedrockAgentCoreAgentRuntime_basic
=== CONT TestAccBedrockAgentCoreAgentRuntime_authorizerConfiguration
=== CONT TestAccBedrockAgentCoreAgentRuntime_protocolConfiguration
=== CONT TestAccBedrockAgentCoreAgentRuntime_artifactContainer
--- PASS: TestAccBedrockAgentCoreAgentRuntime_basic (45.01s)
=== CONT TestAccBedrockAgentCoreAgentRuntime_authorizerConfigurationCustomClaim
--- PASS: TestAccBedrockAgentCoreAgentRuntime_protocolConfiguration (57.83s)
=== CONT TestAccBedrockAgentCoreAgentRuntime_description
--- PASS: TestAccBedrockAgentCoreAgentRuntime_authorizerConfiguration (60.70s)
=== CONT TestAccBedrockAgentCoreAgentRuntime_environmentVariables
--- PASS: TestAccBedrockAgentCoreAgentRuntime_artifactContainer (61.15s)
=== CONT TestAccBedrockAgentCoreAgentRuntime_tags
--- PASS: TestAccBedrockAgentCoreAgentRuntime_description (59.67s)
=== CONT TestAccBedrockAgentCoreAgentRuntime_disappears
--- PASS: TestAccBedrockAgentCoreAgentRuntime_environmentVariables (59.60s)
--- PASS: TestAccBedrockAgentCoreAgentRuntime_authorizerConfigurationCustomClaim (76.83s)
--- PASS: TestAccBedrockAgentCoreAgentRuntime_tags (63.72s)
=== NAME TestAccBedrockAgentCoreAgentRuntime_disappears
agent_runtime_test.go:82: Error running post-test destroy, there may be dangling resources: exit status 1
Error: deleting Bedrock AgentCore Agent Runtime
ID: tf_acc_test_2206906550655035379-DBh5VXGHlw
Cause: operation error Bedrock AgentCore Control: DeleteAgentRuntime, ,
AccessDeniedException: User: arn:aws:iam::123456789012:user/kit is not
authorized to perform: bedrock-agentcore:DeleteAgentRuntime"
--- FAIL: TestAccBedrockAgentCoreAgentRuntime_disappears (28.39s)
FAIL
FAIL github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagentcore 151.367s
FAIL
make: *** [testacc] Error 1|
@tabito-hara Thanks for the contribution 🎉 👏. |
|
Warning This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
|
This functionality has been released in v6.38.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
This bug fix was previously included as part of this PR, but has been introduced in hashicorp#47049 in the interm.
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
Description
This PR adds the
authorizer_configuration.custom_jwt_authorizer.custom_claimblock to theaws_bedrockagentcore_agent_runtimeandaws_bedrockagentcore_gatewayresources.The models for
authorizer_configurationare defined inagent_runtime.goand shared withgateway.go. However, the corresponding schemas are defined separately in each file.This can cause inconsistencies where the models in
agent_runtime.goare updated but the schemas ingateway.goare not.authorizer_config.custom_jwt_authorizer.allowed_scopesargument #46828 and was fixed in [bugfix (regression introduced in v6.36.0)] aws_bedrockagentcore_gateway: Fixauthorizer_configuration.custom_jwt_authorizerschema to resolve "schema mismatch - expected 4 attributes, got 3" error #46908.To address this, this PR extracts the functionality for creating the
authorizer_configurationschema into a reusable function, allowing it to be shared betweenagent_runtime.goandgateway.go.Relations
Closes #47032
References
https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_CustomJWTAuthorizerConfiguration.html
Output from Acceptance Testing
aws_bedrockagentcore_agent_runtimeThe
disappearstest failed due to insufficient permissions, even though I was using an "Admin" role.(According to the debug log,
DeleteAgentRuntimeappears to have been called even after it had already been executed.)Since the latest
mainbranch also exhibits the same error in my environment, this failure does not appear to be related to the changes in this PR.aws_bedrockagentcore_gatewayOne test failed, but it appears not to be related to the fix in this PR.