Add patch enabling IamCredentialProvider on Bedrock AgentCore gateway targets - #6356
Open
dirien wants to merge 1 commit into
Open
Add patch enabling IamCredentialProvider on Bedrock AgentCore gateway targets#6356dirien wants to merge 1 commit into
dirien wants to merge 1 commit into
Conversation
…Core gateway targets Backports hashicorp/terraform-provider-aws#47626 so aws_bedrockagentcore_gateway_target can configure SigV4 signing on the gateway_iam_role credential provider. Required for pointing a Bedrock AgentCore Gateway at an mcp_server endpoint that needs IAM authentication, such as another AgentCore Runtime. Backward compatible: existing 'gateway_iam_role {}' configs continue to send no IamCredentialProvider body.
Contributor
|
PR is now waiting for a maintainer to run the acceptance tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
A backport of an open upstream fix, hashicorp/terraform-provider-aws#47626, as a new patch under
patches/. The patch adds two optional attributes (serviceandregion) to thegateway_iam_roleblock onaws_bedrockagentcore_gateway_target.Why I want this
Without these attributes you cannot use
aws.bedrock.AgentcoreGatewayTargetto point a Bedrock AgentCore Gateway at anmcp_serverendpoint that needs SigV4 signing, like another Bedrock AgentCore Runtime. The schema currently exposesgateway_iam_role {}as an empty block, and the Expand path hard-codesCredentialProvider = nil. AWS happily accepts the create call and returns a 200, but the gateway's tool-discovery probe then fails withMissing Authentication Tokenbecause there is no SigV4 service for the gateway to sign with.I hit this while wiring up the AgentCore Gateway -> AgentCore Runtime MCP server pattern for a workshop. The only workaround today is to drop out of Pulumi for that one resource and call
boto3.create_gateway_target(...)insidepulumi env run, which is fine but ugly.What the patch changes
Forty-two lines added, four removed, all in
internal/service/bedrockagentcore/gateway_target.go:serviceandregionattributes to thegateway_iam_roleschema blockFlattento read the existingIamCredentialProviderbody when one is presentExpandto constructawstypes.CredentialProviderMemberIamCredentialProviderwhenserviceis setServiceandRegionfields togatewayIAMRoleProviderModelIt is byte-identical to the upstream PR and applies cleanly on top of the other 26 patches. Backward compatible too, since existing
gateway_iam_role {}configs still send noIamCredentialProviderbody.After the patch, this works:
What I did not do
I did not regenerate the SDKs. The schema regen does pick up the new
service/regionproperties on the bedrock types, and from there the SDK regen ripples through TypeScript, Python, Go, .NET, and Java. I would rather a maintainer run that on a clean CI machine than push partial SDK diffs from my laptop.Happy to add the SDK regen on top of this PR once a maintainer confirms the direction is fine. Equally happy if you would rather close this and wait for upstream #47626 to merge, then bump the submodule. Either way works for me.
Validation I did run
./scripts/upstream.sh init -fapplies all 27 patches cleanlygo build ./internal/service/bedrockagentcore/...passesgo vet ./internal/service/bedrockagentcore/...passesmake schemaregeneratesaws:bedrock/...GatewayIamRolewith bothserviceandregionproperties present inprovider/cmd/pulumi-resource-aws/schema.jsonLinks