flow-framework icon indicating copy to clipboard operation
flow-framework copied to clipboard

[BUG] The titan embedding template has a hard-coded region in the Bedrock URL

Open Jon-AtAWS opened this issue 3 months ago • 1 comments

What is the bug?

When I use the bedrock_titan_embedding_model_deploy template, I pass in create_connector.region as us-west-2. However the connector has a hard-coded us-east-1 in the Bedrock URL. This is the resulting connector

{
  "name": "Amazon Bedrock Connector: embedding",
  "version": "1",
  "description": "The connector to bedrock Titan embedding model",
  "protocol": "aws_sigv4",
  "parameters": {
    "service_name": "bedrock",
    "region": "us-west-2"
  },
  "actions": [
    {
      "action_type": "PREDICT",
      "method": "POST",
      "url": "https://bedrock-runtime.us-east-1.amazonaws.com/model/amazon.titan-embed-text-v1/invoke",
      "headers": {
        "x-amz-content-sha256": "required",
        "content-type": "application/json"
      },
      "request_body": "{ \"inputText\": \"${parameters.inputText}\" }",
      "pre_process_function": "\n    StringBuilder builder = new StringBuilder();\n    builder.append(\"\\\"\");\n    String first = params.text_docs[0];\n    builder.append(first);\n    builder.append(\"\\\"\");\n    def parameters = \"{\" +\"\\\"inputText\\\":\" + builder + \"}\";\n    return  \"{\" +\"\\\"parameters\\\":\" + parameters + \"}\";",
      "post_process_function": "\n      def name = \"sentence_embedding\";\n      def dataType = \"FLOAT32\";\n      if (params.embedding == null || params.embedding.length == 0) {\n        return params.message;\n      }\n      def shape = [params.embedding.length];\n      def json = \"{\" +\n                 \"\\\"name\\\":\\\"\" + name + \"\\\",\" +\n                 \"\\\"data_type\\\":\\\"\" + dataType + \"\\\",\" +\n                 \"\\\"shape\\\":\" + shape + \",\" +\n                 \"\\\"data\\\":\" + params.embedding +\n                 \"}\";\n      return json;\n    "
    }
  ],
  "created_time": 1757099051934,
  "last_updated_time": 1757099051934
}

### How can one reproduce the bug?
Run the workflow with a different region

### What is the expected behavior?
The Bedrock URL should have the correct region

### What is your host/environment?
MacOS
OpenSearch Service, v2.19

Jon-AtAWS avatar Sep 05 '25 19:09 Jon-AtAWS

Catch All Triage - 1 2 3 4

@dbwiddis Can a maintainer take a look at this request? Thanks!

andrross avatar Oct 06 '25 16:10 andrross