Skip to content

New pattern - Step Functions to Bedrock InvokeModel (CDK)#3083

Open
NithinChandranR-AWS wants to merge 1 commit intoaws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-sfn-bedrock-invokemodel-cdk
Open

New pattern - Step Functions to Bedrock InvokeModel (CDK)#3083
NithinChandranR-AWS wants to merge 1 commit intoaws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-sfn-bedrock-invokemodel-cdk

Conversation

@NithinChandranR-AWS
Copy link
Copy Markdown

Description

This pattern deploys a Step Functions Express workflow that invokes Amazon Bedrock (Claude Sonnet) directly using the native InvokeModel optimized integration — no Lambda function required. Deployed with AWS CDK.

Key Features

  • No Lambda — Step Functions calls Bedrock directly via BedrockInvokeModel L2 CDK construct
  • Express workflow for synchronous sub-5-minute executions
  • resultSelector extracts response text, model, and usage metadata
  • Built-in retry with exponential backoff (3 attempts, 20s base interval)
  • Inference profile ARN via ProvisionedModel.fromProvisionedModelArn (required for cross-region inference profiles)

Architecture

Step Functions (Express) ──▶ Amazon Bedrock (Claude Sonnet)

Testing

Deployed and tested on AWS account. Verified:

  • SUCCEEDED execution status
  • Successful Bedrock Claude Sonnet response with usage metadata
  • Fixed: FoundationModel.fromFoundationModelId generates foundation-model ARN but inference profiles need inference-profile ARN — used ProvisionedModel.fromProvisionedModelArn with constructed ARN

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation (README.md)
  • My changes generate no new warnings
  • New and existing tests pass locally with my changes
  • example-pattern.json included

Step Functions Express workflow that invokes Amazon Bedrock Claude
Sonnet directly using the native InvokeModel optimized integration.
No Lambda function required — reduces latency, cost, and complexity.

- BedrockInvokeModel L2 CDK construct with resultSelector
- Express workflow for synchronous sub-5-minute executions
- Built-in retry with exponential backoff (3 attempts, 20s base)
- Scoped IAM for inference profile + foundation model ARNs
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