Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. READ MORE

How to get started with the Amazon Bedrock connector in Qlik Application Automation

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Yamini-Singh
Support
Support

How to get started with the Amazon Bedrock connector in Qlik Application Automation

Last Update:

Jul 2, 2024 7:31:57 AM

Updated By:

Yamini-Singh

Created date:

Nov 21, 2023 6:23:19 AM

Amazon Bedrock is a fully managed service that makes base models from Amazon and third-party model providers accessible through an API.

This article explains how the Amazon Bedrock connector in Qlik Application Automation can be used within Qlik Cloud.

Content:

 

Authentication

AWS Setup

By default, users and roles don't have permission to create or modify Bedrock resources. They cannot perform tasks using the AWS Management Console, AWS Command Line Interface (AWS CLI), or AWS API. To grant users permission to perform actions on the resources that they need, an IAM administrator can create IAM policies. The administrator can then add the IAM policies to roles, and users can assume the roles.

To learn how to create an IAM identity-based policy by using these sample JSON policy documents, see Creating IAM policies in the IAM User Guide.

  1. Open the AWS console
  2. Navigate to Identity and Access Management (IAM) 
  3. Click Create User and enter the new username. 

    Optionally, you can also give separate console access to the user.


    create user.png

  4. In the Create User editor, you can select one of the three options.

    For our example, let’s select the highlighted option Attach policies directly.

    set permissions attach policies directly.png

  5. Scroll down. In the Permissions Policies text box, type and search for Bedrock Full Access

    permission policies bedrock.png

  6. (Optional) Expand Set permissions boundary - optional and set Use permissions boundary to control the maximum permissions 

    Review the on-screen text for details.

    set permissions boundary.png
     
  7. Review and create user.
  8. Navigate to the Security Credentials tab.
  9. Click Create Access Key.

    access keys.png

  10. For Use Case, click Third-party service and follow the recommendations. A description tag is optional.
  11. Click Create Access Key
  12. Copy the Access Key and Secret Access Key values.

    Store them safely. The Secret Access Key will only be shown once. See Access key best practices onscreen. 

    retrieve access key.png

     

Qlik Cloud

  1. Open Qlik Cloud
  2. Navigate to My Automations

    my automations.png

  3. Switch to the Connections tab

    Connections.png

  4. Click Add new connection.
  5. Search for Amazon Bedrock and click Add.

    amazon bedrock.png

  6. Provide the access key and secret access key and specify where your AWS region is located.

    amazon bedrock credentials.png

 

Available blocks

The Amazon Bedrock connector consists of the following blocks:

  • Invoke Model
  • List Foundation Models
  • List Custom Models

Examples for the Invoke Model Endpoint

Example 1: Using amazon.titan-text-express-v1

  1. Drag and drop the Invoke Model block from the left-hand side menu.

  2. In Model ID, enter amazon.titan-text-express-v1 or choose it from the lookup dropdown. 

  3. In Body, enter:

    KeyinputText
    Value: a prompt of your choice for testing. In our example, we use Hello, what is the date today?

invokemodel.png

  1. Run the block and review its output in the History tab

Invoke Model history.png

 

Example 2: Using amazon.titan-tg1-large

  1. Drag and drop the Invoke Model block from the left-hand side menu.

  2. In Model ID, enter amazon.titan-tg1-large or choose Amazon Titan Text Large from the lookup dropdown. 

  3. In Body, enter:

    KeyinputText
    Value: a prompt of your choice for testing. In our example, we use Hello, what is the date today?

    or

    Switch to Raw input and design a JSON based on the same:

    {
    "inputText":"Picture of a bird"
    }

    invoke model amaon titan text large.png

  4. Run the block and review its output in the History tab

test amazon titan large model.png

 

Example 3: Using stability.stable-diffusion-xl (Text to Image)

  1. Drag and drop the Invoke Model block from the left-hand side menu.

  2. In Model ID, enter stability.stable-diffusion-xl or choose Stability AI Stable Diffusion XL from the lookup dropdown. 

  3. In Body, switch to Raw Input and design the following JSON based on a prompt of your choice:

    {
    "text_prompts":[{"text":"A lighthouse on a cliff","weight":0.5}]
    }

    invoke model stable diffusion.png

  4. Run the block and review its output in the History tab

    run model stability diffusion.png

  5. To test this use case, copy the base64 output and paste it into a Base64 to Image converter

base64 converter.png

Labels (2)
Comments
ÖnderAltınbilek
Partner - Contributor
Partner - Contributor

The Amazon Bedrock connector is currently not functioning. I assume this issue arises because the API endpoint for Amazon has changed. The correct endpoint should be bedrock-runtime.<region>.amazonaws.com, instead of the previously used bedrock.<region>.amazonaws.com. (https://docs.aws.amazon.com/general/latest/gr/bedrock.html)

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @ÖnderAltınbilek 

We're reviewing this currently, thank you!

All the best,
Sonja 

Version history
Last update:
Tuesday
Updated by: