- The problem: how to connect your app to Bedrock
- The solution: Bedrock API and Bedrock Runtime API
- A simpler workflow using the AWS SDK
- A short demonstration and expected results
- A summary and a hands-on lab

The problem: How do we connect our application to Amazon Bedrock?
If your application needs to provide generative AI features, it must interact programmatically with Bedrock. Typical responsibilities include:- Sending prompts to models to perform inference.
- Managing available models, guardrails, and configuration (control plane).

- SigV4 request signing
- Retries and exponential backoff
- Serialization and deserialization of JSON payloads
- Error handling and status parsing
The solution: Bedrock API vs Bedrock Runtime API
There are two APIs to know:
Both are REST-over-HTTPS, require IAM authentication using SigV4, and return JSON responses.

Direct REST (manual) — what it looks like
If you choose to call the runtime endpoint manually, you perform an HTTPS POST with a SigV4 Authorization header and a JSON body. Example (pseudocode):Recommended workflow: Use the AWS SDK
The AWS SDKs (e.g., Boto3 for Python, AWS SDK for JavaScript/TypeScript, AWS SDK for Java, .NET, PHP) provide a higher-level interface that:- Performs SigV4 signing automatically
- Serializes requests and deserializes JSON responses
- Handles retries, timeouts, and credential resolution
- Exposes simple method calls for runtime and control-plane actions
bedrock and bedrock-runtime to keep configuration and inference operations distinct.

Example: creating a Bedrock Runtime client in Python (Boto3)
Notes before the example:- The Python SDK is called Boto3.
- Use the service name
bedrock-runtimefor inference calls andbedrockfor control-plane calls. - Configure credentials and region (shared credentials file, environment variables, or IAM role).
- Ensure the Bedrock service is available in the chosen region.
- Name your clients clearly (
inference_client,config_client) to avoid confusion. - Verify the service is available in your AWS Region: consult the official AWS Regional Services List.
- The SDK handles SigV4 signing; you do not need to implement signing logic manually.
Use separate SDK clients for runtime (
bedrock-runtime) and control-plane (bedrock) operations. The SDK handles signing, retries, and serialization, which simplifies development and reduces errors.Short demonstration and expected results
Typical demo flow:- Use the control-plane client (
bedrock) to list available models or configure a knowledge base. - Use the runtime client (
bedrock-runtime) to invoke a model with a text prompt. - Receive a JSON response containing the generated text (or streamed tokens if using streaming APIs).
- Handle errors (throttling, validation errors) by relying on the SDK’s retry/backoff behavior and inspecting exception details.
- Faster development: no manual signing or JSON plumbing.
- Cleaner code: method calls instead of raw HTTP requests.
- More robust apps: built-in retries and credential management.
Summary and next steps
- Problem: Applications need programmatic access to models and configuration.
- Solution: Two APIs — control-plane (
bedrock) and runtime (bedrock-runtime) — each mapped to separate API endpoints and SDK clients. - Recommendation: Use the AWS SDK for your language (Boto3 shown for Python) to handle signing, retries, and serialization.
- Next: Follow a hands-on lab to list models, invoke a model, and inspect outputs. For production, integrate error handling, rate-limit awareness, and logging.
Links and References
- Amazon Bedrock documentation: https://docs.aws.amazon.com/bedrock/
- AWS SDKs: https://aws.amazon.com/tools/
- Boto3 documentation: https://boto3.amazonaws.com/v1/documentation/api/latest/index.html
- Signature Version 4 signing process: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html