Deploy an Amazon Bedrock Studio chat app - Amazon Bedrock Studio

Amazon Bedrock Studio, renamed to Amazon Bedrock IDE, is now available in Amazon SageMaker Unified Studio. Amazon Bedrock Studio will be available until February 28, 2025. You may access existing workspaces in this previous version through February 28, 2025, but you may not create new workspaces. To access the enhanced GA version of Amazon Bedrock Studio with additional features and capabilities, you can create a new Amazon SageMaker Unified Studio domain. To learn about Amazon Bedrock Studio IDE, see the documentation.

Deploy an Amazon Bedrock Studio chat app

The following instructions show you the steps you take to deploy a chat app that you export from Amazon Bedrock Studio.

Prerequisites for deploying a chat app

Before you can deploy a chat app that you have exported, you must first do the following:

To prepare for app deployment
  1. Install the latest version of the AWS CLI on your local machine by following the instructions at Install or update to the latest version of the AWS CLI.

  2. Set up AWS credentials for the AWS CLI on your local machine by following the instructions at Configure the AWS CLI. The credentials that the deployment script uses will follow the order of precedence.

  3. Create an IAM role that includes the policies from provisioning-inline-policy.json. For information about creating a role, see IAM role creation.

  4. (Optional) Using the AWS account that you set up in step 2, create an AWS KMS key for app export by following the instructions at Creating keys. The key must be tagged with key EnableBedrock and a value of true. The key must also have a key policy that allows it to be used for encryption of your chat app resources. You may use the suggested policy declared in the kms-key-policy.json file of your zip package.

  5. Create an Amazon S3 bucket to hold the app files that you export by following the instructions at Creating a bucket.

  6. If your app includes a Knowledge Base, copy the data source file to a folder named data/ in the Amazon S3 bucket that you created in step 5. If your app uses a document as a datasource, you supply a list of datasource files to the deployment script. For more information, see Deploy the chat app.

  7. If your app calls a function that requires authorization keys, provision the keys in AWS Secrets Manager by running the following command:

    aws secretsmanager update-secret \ --secret-id br-studio/function-name-export-environment-id \ --secret-string 'secret-value'

    Replace the following values:

    • function-name — to the unique name of your function call component.

    • export-environment-id — to the unique id of your function call component.

    • secret-value — to the intended value to be used for authentication:

      If the function requires API Keys, the syntax of secret-value should be: {"key-name-1":"key-value-1","key-name-2":"key-value-2"}

      If the function requires Basic authentication, the syntax of secret-value should be: {"___AuthType___":"BASIC", "username":"username-value", "password":"password-value"}

      If the function requires Bearer token authentication, the syntax of secret-value should be: {"___AuthType___":"BEARER", "tokenValue":"token-value"}

  8. Next step: Deploy the chat app.

Deploy the chat app

Before deploying your chat app, be sure to do the prerequisite steps.

Deploying a chat app deploys the AWS infrastructure files that you need to run the app in AWS.

To deploy a chat app
  1. At the command prompt, do the following:

    1. Navigate to the zip file that you exported from Amazon Bedrock Studio.

    2. Assume the role of the AWS that you created in step 3 of Prerequisites for deploying a chat app.

    3. Run the following command:

      ./deployApp.sh \ [--awsRegion=value] \ [--s3BucketName=value] \ [--assetsS3Path=value] \ [--kmsKeyArn=value] \ [--dataFiles=value]

      Replace the following values:

      • awsRegion — with the AWS Region that you want to deploy the app to. Amazon Bedrock must be available in the Region you use. For more information, see Supported AWS Regions.

      • s3BucketName — With the Amazon S3 bucket that you created in step 5 of Prerequisites for deploying a chat app. The deployment store the CFN templates and application data files in this bucket.

      • assetsS3Path — (Optional) With the path in s3BucketName that you want deployment to store application files to.

      • kmsKeyArn — (Optional) with the ARN of the KMS Key that you created in step 3 of Prerequisites for deploying a chat app.

      • dataFiles — With a comma-separated list of data source file paths. Required for apps that use a document data source.

      For example, if you have a chat app with a single document as a data source, and you want to deploy the app with encryption, you can use the following command.

      sudo sh ./deployApp.sh \ --awsRegion=us-east-1 \ --s3BucketName=my-s3-bucket-name-for-exported-chat-apps \ --assetsS3Path=my-prod-folder/my-chat-app \ --kmsKeyArn=arn:aws:kms:us-east-1:111122223333:key/11111111-2222-3333-4444-555555555555 \ --dataFiles=my-data-source.pdf
  2. (Optional) Monitor the deployment in the AWS CloudFormation console.

  3. Note the output from the script. You need it to run the chat app. It should be similar to: node brStudioApp.mjs --question="Tell me about my documents".

  4. Next step: Run a deployed chat app.