aws / aws/bedrock-agentcore-starter-toolkit

[BUG] create_mcp_gateway_target not actually using IAM_ROLE credential provider for lambda when target_payload provide

Open
#56 2 comments 0 reactions 0 assignees View on GitHub
bug gateway
Dominant language
Python
Stars
508
Forks
155
Avg merge
8h 50m
Merged PRs (30d)
4

Description

**Describe the bug**
For lambda target, when the target_payload param given, the credential provider config is not provided for `create_gateway_target` API. Similar like #34.

**To Reproduce**
Steps to reproduce the behavior:
1. Follow the steps at the official doc at https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-quick-start.html#gateway-quick-start-create
2. Call `create_mcp_gateway_target` with the `target_payload` for the lambda case.
3. Run the code with the necessary packages.

**Expected behavior**
The gateway and the lambda type target should be created successfully.

**Error Output**
```
Traceback (most recent call last):
File "/home/ubuntu/aws-agentcore/gw.py", line 61, in
lambda_target = client.create_mcp_gateway_target(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/aws-agentcore/.venv/lib/python3.12/site-packages/bedrock_agentcore_starter_toolkit/operations/gateway/client.py", line 162, in create_mcp_gateway_target
target = self.client.create_gateway_target(**create_request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/aws-agentcore/.venv/lib/python3.12/site-packages/botocore/client.py", line 601, in _api_call
return self._make_api_call(operation_name, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/aws-agentcore/.venv/lib/python3.12/site-packages/botocore/context.py", line 123, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/aws-agentcore/.venv/lib/python3.12/site-packages/botocore/client.py", line 1031, in _make_api_call
request_dict = self._convert_to_request_dict(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/aws-agentcore/.venv/lib/python3.12/site-packages/botocore/client.py", line 1098, in _convert_to_request_dict
request_dict = self._serializer.serialize_to_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/aws-agentcore/.venv/lib/python3.12/site-packages/botocore/validate.py", line 381, in serialize_to_request
raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Missing required parameter in input: "credentialProviderConfigurations"
```

**Environment:**
- OS: Ubuntu 24.04
- Python version: 3.12
- Package version:
"bedrock-agentcore>=0.1.0",
"bedrock-agentcore-starter-toolkit>=0.1.0",
"strands-agents>=1.0.1",
"strands-agents-tools>=0.2.1",
- Installation method: uv/pip

**Additional context**
N/A

Contributor guide

Open the contributing guide

Research direction

Start in bedrock_agentcore_starter_toolkit/operations/gateway/client.py around line 162, where create_mcp_gateway_target calls create_gateway_target for a Lambda target with target_payload. Reproduce the call using the gateway quick-start steps and inspect the generated request; done means the IAM_ROLE credential provider configuration is included and the target is created without the missing-parameter validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
api, cloud
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.