Skip to content

New pattern - agentcore-gateway-lambda-cdk#3085

Open
NithinChandranR-AWS wants to merge 5 commits intoaws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-agentcore-gateway-lambda-cdk
Open

New pattern - agentcore-gateway-lambda-cdk#3085
NithinChandranR-AWS wants to merge 5 commits intoaws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-agentcore-gateway-lambda-cdk

Conversation

@NithinChandranR-AWS
Copy link
Copy Markdown

Description

Deploy an Amazon Bedrock AgentCore Gateway with Lambda tool targets, exposing tools via the MCP protocol with IAM authentication.

Changes

  • lib/agentcore-gateway-lambda-stack.ts — CDK stack: AgentCore Gateway + Lambda tool target with MCP protocol
  • src/index.js — Lambda handler with input validation and error sanitization
  • README.md — Architecture, deployment steps, and testing instructions (tools/list + tools/call)
  • example-pattern.json — Pattern metadata with services field

Testing

  • cdk synth — clean, 7 resources
  • Deployed to AWS account, tested tools/list and tools/call via MCP
  • Input validation: 100-char limit, regex sanitization, required field checks
  • IAM: least-privilege, grantInvoke scoped to specific Lambda

- Fix Bedrock model ID default (add -v1:0 suffix for inference profile)
- Fix DurableExecution → DurableConfig with ExecutionTimeout
- Override runtime to nodejs24.x (required for durable functions)
- Remove logRetention to avoid circular dependency with CfnVersion
- Use wildcard resource for durable execution IAM permissions

Tested: CDK synth verified, deployed to AWS account
- Scope Bedrock InvokeModel to inference-profile and foundation-model
  ARNs instead of wildcard
- Replace inline durable execution policy with
  AWSLambdaBasicDurableExecutionRolePolicy managed policy
- Publish a Lambda version via CfnVersion for qualified invocation
- Add FunctionVersion output for testing instructions
- Fix README title, clarify testing with explicit placeholder replacement
- Trim example-pattern.json description to 128 chars
… pattern

Deploy an Amazon Bedrock Agent powered by OpenAI GPT OSS model with
a Lambda action group for tool use (weather + time). First pattern
combining Bedrock Agents with OpenAI models on Bedrock.
… tools pattern

Deploy an AgentCore Gateway exposing Lambda functions as MCP tools.
First CDK pattern for AgentCore Gateway with Lambda tool targets,
inline tool schemas, and IAM authentication.
@NithinChandranR-AWS
Copy link
Copy Markdown
Author

Hi @biswanathmukherjee 👋 Friendly nudge — this pattern is ready for review. Deployed and tested end-to-end on a live AWS account. Would appreciate a look when you have time. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants