Skip to content

New pattern - bedrock-agent-openai-cdk#3084

Open
NithinChandranR-AWS wants to merge 4 commits intoaws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-bedrock-agent-openai-cdk
Open

New pattern - bedrock-agent-openai-cdk#3084
NithinChandranR-AWS wants to merge 4 commits intoaws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-bedrock-agent-openai-cdk

Conversation

@NithinChandranR-AWS
Copy link
Copy Markdown

Description

Deploy an Amazon Bedrock Agent powered by OpenAI GPT OSS (gpt-oss-20b) with a Lambda action group for tool use.

Changes

  • lib/bedrock-agent-openai-stack.ts — CDK stack: Bedrock Agent + OpenAI foundation model + Lambda action group with OpenAPI schema
  • src/index.js — Lambda handler with input validation and error sanitization
  • README.md — Architecture, deployment steps, and testing instructions
  • example-pattern.json — Pattern metadata with services field

Testing

  • cdk synth — clean, 7 resources
  • Deployed to AWS account, tested single-tool and multi-tool agent queries
  • Input validation: 100-char limit, regex sanitization, required field checks
  • IAM: least-privilege, scoped to specific model ARN

- 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.
@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