DeployFrame Docs

AWS Bedrock Setup

Enable AWS Bedrock services for AI image generation in your platform

AWS Bedrock Setup

To enable the image generation features in your AI SaaS platform, you need to set up AWS Bedrock and request access to the Amazon Titan Image Generator v2 model. This guide will walk you through the process step by step.

Prerequisites

Before proceeding, ensure you have:

  • Deployed your core infrastructure successfully
  • Access to your AWS account with administrator privileges
  • Updated your .env file with the AWS Bedrock region

Setting up AWS Bedrock

Verify Environment Variables

First, check that the AWS Bedrock region is properly set in your .env file in the cdk directory:

# AWS Bedrock Configuration
AWS_BEDROCK_REGION=us-east-1

You should have already set this variable during the initial configuration. The Titan Image Generator v2 model is primarily available in the us-east-1 (N. Virginia) region, which is why we specify this region separately from your deployment region.

If this environment variable is missing, add it now before proceeding. The image generation services will not work without the correct region configuration.

Access AWS Bedrock Console

  1. Log in to the AWS Management Console
  2. Make sure you're in the US East (N. Virginia) - us-east-1 region by checking the region selector in the upper right corner
  3. Search for "Bedrock" in the search bar and select it
  4. If this is your first time accessing Bedrock, you'll see a welcome screen
  5. Click "Get started" to proceed

If you've never used AWS Bedrock before, you'll need to complete an initial setup process.

  1. In the AWS Bedrock console, scroll down the left sidebar until you find the "Bedrock configuration" section
  2. Click on "Model access" under this section
  3. You'll see a table of available foundation models categorized by provider
  4. Look for the "Amazon" section in the table
  5. You can either scroll down to find "Titan Image Generator G1 v2" or use the search bar to find it

Request Access to Amazon Titan Image Generator v2

  1. In the "Access status" column next to "Titan Image Generator G1 v2", click on "Available to request"
  2. A side panel will appear - click on "Request model access"
  3. Scroll down in the panel and click the "Next" button
  4. Review the information and click the "Submit" button

You'll be redirected back to the base models list table after submitting your request.

Verify Access Status

  1. After a few minutes, refresh the model access page
  2. Check the "Access status" column for "Titan Image Generator G1 v2"
  3. The status should change from "Available to request" to "Access granted"
  4. If the status doesn't update immediately, wait a few more minutes and refresh again

If your access request is not approved within 30 minutes, check that your AWS account is in good standing and has the necessary permissions.

Redeploy Your Infrastructure

Now that you have access to the required Bedrock model and have updated your environment variables, redeploy your infrastructure:

cd cdk
cdk deploy --all --require-approval never

This deployment will update your Lambda functions with the AWS_BEDROCK_REGION environment variable, allowing them to connect to the correct region for image generation services.

Verifying Bedrock Integration

After deploying with AWS Bedrock configuration, it's important to verify that the image generation service is working correctly:

Access Your AI Services

  1. Navigate to your application URL
  2. Sign in to your account
  3. Go to the AI Services section
  4. Select the "Image Generation" service

Test Image Generation

  1. Enter a descriptive prompt (e.g., "A scenic mountain landscape with a lake")
  2. Select image size and other available options
  3. Click "Generate"
  4. Verify that the image is generated successfully

The generation process typically takes 5-10 seconds. If successful, you'll see the generated image displayed in the interface.

Check Credit Usage

  1. After generating an image, check your credit balance
  2. Verify that credits were deducted according to the service pricing configuration

Troubleshooting

If you encounter issues with the image generation service, check the following:

  1. Region Configuration: Ensure AWS_BEDROCK_REGION is set to us-east-1 in your .env file
  2. Access Status: Verify that access to Amazon Titan Image Generator G1 is still granted in the Bedrock console
  3. Lambda Logs: Check CloudWatch logs for any errors in the image generation Lambda function

Next Steps

Now that you've configured AWS Bedrock for image generation, proceed to OpenAI Setup to enable additional AI services with OpenAI's models.