You need to set up your Redis Cloud database before you can set it as the vector database in Amazon Bedrock. To do this, you need to:

  1. Sign up for Redis Cloud and create a database
  2. Enable Transport Layer Security (TLS) for the database and save the certificates
  3. Store database credentials in AWS secrets manager
  4. Create a vector index in your database for Bedrock to use

After you set up the database, you can use the database information to set it as your knowledge base database when you create a knowledge base.

Sign up and create a database

To set up a Redis Cloud instance for Bedrock, you need to:

  1. Sign up for Redis Cloud if you do not already have an account.
  2. Create a subscription and database to use for your Bedrock knowledge base.

Sign up for Redis Cloud using AWS Marketplace

  1. Select the Redis Cloud AWS marketplace link from Bedrock to be taken to the Redis Cloud - Flexible plan listing.

    The Redis Cloud - Flexible plan listing on AWS Marketplace
  2. Subscribe to Redis Cloud - Flexible plan, locate the Set Up Your Account button, and then select it to begin mapping your Redis Cloud account with your AWS Marketplace account.

    Use the Set Up Your Account button after subscribing to Redis Cloud with your AWS Marketplace account.
  3. Sign in to the Redis Cloud admin console.

  4. Select the Redis account to be mapped to your AWS Marketplace account and confirm that your payment method will change and that the connection cannot be undone.

    Use the AWS Marketplace dialog to map your Redis Cloud account to your AWS Marketplace account.
  5. Use the Map account button to confirm your choice.

  6. Once your Redis account is mapped to your AWS Marketplace account, a message appears in the upper, left corner of the account panel.

    The AWS Marketplace badge appears when your Redis Cloud account is mapped to an AWS Marketplace account.

    In addition, AWS Marketplace is reported as the selected payment method.

Create a flexible subscription

  1. In the admin console, select Add new subscription.

    The New subscriptions button in the admin console menu.
  2. When the New subscription page appears, select Flexible plans.

    Available subscription plans; Flexible plan is selected.
  3. Select Amazon Web Services as the cloud vendor, select a region, and enter a name for your subscription.

    The General settings of the Setup tab.
  4. In the Version section, select Redis 7.2.

    Version selection between Redis 6.2 and 7.2
  5. In the Advanced options section, select Multi-AZ to ensure high-availability.

    The Multi-AZ toggle set to on.
  6. Enter a CIDR range of IP addresses for your deployment in the Deployment CIDR field.

    The Deployment CIDR field.
  7. When finished, select Continue.

    Select the Continue button to continue to the next step.
  8. The Sizing tab helps you specify the database requirements for your subscription.

    The Sizing tab when creating a new Flexible subscription.

    Select the Add button to create a database.

    Use the Add button to define a new database for your subscription.
  9. In the New Database dialog, name your database and select Search and query.

    The New Database dialog with basic settings.
  10. Set the Memory limit of your database based on the amount of data that will be pulled from your Simple Storage Service (S3) bucket. See Find out the size of your S3 buckets to find out how much training data is stored in your S3 bucket and pick the closest size from the table below.

    Total Size of Documents in S3 Database size without replication Database size with replication
    10,000 kb 135 Mb 270 Mb
    100,000 kb 1.35 Gb 2.7 Gb
    1,000,000 kb 13.5 Gb 27 Gb
    10,000,000 kb 135 Gb 270 Gb

    For more information on sizing, see the Bedrock integration blog post.

  11. When finished, select Save database to create your database.

    Select the Save Database button to define your new database.
  12. Select Continue to move to the Review and Create tab.

  13. Review your subscription. You will not need to enter a payment method, as it’s automatically assigned to your AWS Marketplace account.

  14. Select Create subscription to create your new flexible subscription.

    Select Create subscription to create your new subscription.

    Note that subscriptions are created in the background. While they are provisioning, you aren’t allowed to make changes. (The process generally takes 10-15 minutes.)

    Use the Subscriptions list to check the status of your subscription. You will also receive an email when your subscription is ready to use.

Enable TLS and get certificates

For your database to be fully secure, you must enable Transport Layer Security (TLS) for your database with client authentication.

  1. Select Databases from the admin console menu and then select your database from the list.

  2. From the database’s Configuration screen, select the Edit database button:

    The Edit database button lets you change selected database properties.
  3. In the Security section, use the Transport layer security (TLS) toggle to enable TLS:

    Use the Transport Layer Security toggle to enable TLS.
  4. Select Download server certificate to download the Redis Cloud certificate bundle redis_ca.pem:

    Use the Download server certificate button to download the Redis Cloud CA certificates.
  5. Either provide an X.509 certificate that contains a public key for your client or select Generate certificate to create one:

    Provide or generate a certificate for TLS client authentication.

    If you generate your certificate from the admin console, select Download client certificate. The download contains:

    • redis_user.crt – the certificate’s public key.

    • redis_user_private.key – the certificate’s private key.

  6. To apply your changes and enable TLS, select the Save database button:

    Use the Save database button to save database changes.

Store database credentials in AWS secrets manager

In the AWS Management Console, use the Services menu to locate and select Security, Identity, and Compliance > Secrets Manager. Create a secret of type Other type of secret with the following key/value fields:

  • username: Database username
  • password: Database password
  • serverCertificate: Contents of the server certificate (redis_ca.pem)
  • clientCertificate: Contents of the client certificate (redis_user.crt)
  • clientPrivateKey: Contents of the client private key (redis_user_private.key)

After you store this secret, you can view and copy the Amazon Resource Name (ARN) of your secret on the secret details page.

Create a vector index in your database

After your database is set up, create an index with a vector field using FT.CREATE as your knowledge base for Amazon Bedrock. You can accomplish this using RedisInsight or redis-cli.


RedisInsight is a free Redis GUI that allows you to visualize and optimize your data in Redis.

To create your vector index in RedisInsight:

  1. Download and install RedisInsight if you don’t have it already.

  2. In the Redis Cloud admin console, in your subscription’s Databases tab, select the Connect button next to your database to open the connection wizard.

    Connect button

  3. In the connection wizard, under RedisInsight Desktop, select Public Endpoint. Select Open with RedisInsight to connect to the database with RedisInsight.

  4. Select Use TLS. In the CA Certificate section, select Add new CA certificate. Give the certificate a name in the Name field, and enter the contents of redis_ca.pem into the Certificate field.

    The RedisInsight Add CA Certificate section.
  5. Select Requires TLS Client Authentication. In the Client Certificate section, select Add new certificate. Give the certificate a name in the Name field. Enter the contents of redis_user.crt into the Certificate field, and the contents of redis_user_private.key into the Private Key field.

    The RedisInsight Add Client Certificate section.
  6. Select Add Redis Database to connect to the database.

  7. Select your database alias to connect to your database. Select the Workbench icon to go to the workbench.

    The RedisInsight workbench icon.
  8. Enter the FT.CREATE command to create an index.

    FT.CREATE <index_name>                    
        ON HASH                
            "<text_field>" TEXT
            "<metadata_field>" TEXT                   
            "<vector_field>"  VECTOR FLAT     
                "TYPE" "FLOAT32"            
                "DIM" 1536                   
                "DISTANCE_METRIC" "COSINE"  

    Replace the following fields:

    • <index_name> with the vector index name
    • <text_field> with the text field name
    • <metadata_field> with the metadata field name
    • <vector_field> with the vector field name
  9. Select Run to create the index.

    The RedisInsight run button.


The redis-cli command-line utility lets you connect and run Redis commands directly from the command line. To use redis-cli, you can install Redis.

Public endpoint and port details are available from the Databases list or the database’s Configuration screen. Select Connect to view how to connect to your database with redis-cli.

redis-cli -h <endpoint> -p <port> --tls --cacert redis_ca.pem \
    --cert redis_user.crt --key redis_user_private.key

After you are connected with redis-cli, create an index using FT.CREATE.

FT.CREATE <index_name>                    
    ON HASH                
        "<text_field>" TEXT
        "<metadata_field>" TEXT                   
        "<vector_field>"  VECTOR FLAT     
            "TYPE" "FLOAT32"            
            "DIM" 1536                   
            "DISTANCE_METRIC" "COSINE"  

Replace the following fields:

  • <index_name> with the vector index name
  • <text_field> with the text field name
  • <metadata_field> with the metadata field name
  • <vector_field> with the vector field name

Next steps

After your Redis subscription and database is set up, you can use it to create a knowledge base in Amazon Bedrock.