Hi Sathish,
I'm just touching base regarding your query about the Amazon Bedrock integration.
Were you able to implement the Amazon Bedrock Connector successfully with the latest release? If you've had a chance to try it out, we'd love to hear about your experience, whether it was smooth sailing or if you hit a snag somewhere along the line.
If you're still encountering any issues, or if you have further questions, please don't hesitate to reach out.
Best,
Trong
Hi Sathish Kumar,
I'm Trong from the team that has developed the Amazon Bedrock Connector.
Firstly, I'd like to express my appreciation for sharing your issue in such detailed manner. Your contribution could be invaluable to others who might encounter similar challenges.
Upon a thorough examination of the provided error logs and details, I believe the root of the issue might stem from the accessibility of the model you're trying to invoke via the API. The nature of the "400: Bad Request" error, combined with the message that the "requested operation is not recognized by the service," leads me to think that your credential set and/or AWS organization might not have the necessary permissions or access to the specific model you're attempting to invoke.
To address this, I suggest you navigate to the Amazon Bedrock Model Access section within the Amazon Bedrock environment. In this section, you should see an overview of the available models and their respective accessibility status concerning your AWS organization. The status you're looking for should read Access Granted. If you notice a status that indicates "Available" instead, it would mean that the model is available, but not yet accessible by your credentials. You can enable access by following these steps:
Be advised that the process of being granted access can take up to 10 minutes, after which the status should display as Access Granted.
I hope this helps!
Best,
Trong
Dear Sathish Kumar,
These credentials might not have the permissions for the API actions associated with Amazon Bedrock.
To put this hypothesis to the test, I suggest crafting a new set of credentials that solely have the rights requisite for the example implementation.
Here is a step-by-step on how to generate a fresh set of credentials:
JSON snippet:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:ListFoundationModels"
],
"Resource": "*"
}
]
}
This IAM policy will allow the IAM user to invoke the API actions ListFoundationModels and InvokeModel that are associated with Amazon Bedrock and are crucial in making the Example Implementation operable.
Best,
Trong
Hi Sathish,
I've engaged my team to conduct an investigation into this issue. We recently encountered a similar situation. In that scenario, an AWS organization, not affiliated to us, was capable of listing the foundation models via the ListFoundationModels action, but subsequently encountered errors invoking the returned models. To better understand this, a member from our team set up a private AWS account, granted access to AI21's models, and created a new IAM user with the specific permission to invoke Amazon Bedrock's API. Unfortunately, the results mirror your experience, as we faced a 400 Bad Request with the same message: "The requested operation is not recognized by the service."
From our comprehensive examination, testing, and the reproducibility of this issue, we have drawn a preliminary conclusion. It appears that the root cause might be attributed to the Amazon Bedrock service itself rather than a misconfiguration on our end or yours. We are engaging with AWS directly to share (y)our findings and to seek a way forward.
For your records and as an additional tool for diagnosis, I've attached a JSON snippet at the end of this message, only omitting our AWS credentials. This snippet represents a Postman collection, comprising of a HTTP POST request as recreated by the information you have provided. Notably, this has been found to function seamlessly with our credentials, assumingly because those that had been previously granted preview access to Amazon Bedrock.
{ "info": { "_postman_id": "9969a71b-9427-4ad2-8242-d97f2b7be89e", "name": "Amazon Bedrock", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "_exporter_id": "25022662" }, "item": [ { "name": "Oregon (us-west-2)", "protocolProfileBehavior": { "disabledSystemHeaders": { "content-type": true } }, "request": { "auth": { "type": "awsv4", "awsv4": [ { "key": "accessKey", "value": "", "type": "string" }, { "key": "secretKey", "value": "", "type": "string" }, { "key": "region", "value": "us-west-2", "type": "string" }, { "key": "service", "value": "bedrock", "type": "string" }, { "key": "addAuthDataToQuery", "value": false, "type": "boolean" }, { "key": "sessionToken", "value": "", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\"prompt\":\"Write an engaging product description for a clothing eCommerce site. Make sure to include the following features in the description. \\nProduct: Humor Men's Graphic T-Shirt. \\nFeatures: \\n- Soft cotton \\n- Short sleeve\\n- Have a print of Einstein's quote: \\\"artificial intelligence is no match for natural stupidity” \\nDescription: \",\"maxTokens\":200,\"temperature\":0.5,\"topP\":0.5,\"stopSequences\":[],\"countPenalty\":{\"scale\":0,\"applyToWhitespaces\":false,\"applyToNumbers\":false,\"applyToEmojis\":false,\"applyToPunctuations\":false,\"applyToStopwords\":false},\"presencePenalty\":{\"scale\":0,\"applyToWhitespaces\":false,\"applyToNumbers\":false,\"applyToEmojis\":false,\"applyToPunctuations\":false,\"applyToStopwords\":false},\"frequencyPenalty\":{\"scale\":0,\"applyToWhitespaces\":false,\"applyToNumbers\":false,\"applyToEmojis\":false,\"applyToPunctuations\":false,\"applyToStopwords\":false}}" }, "url": { "raw": "https://bedrock.us-west-2.amazonaws.com/model/ai21.j2-mid/invoke", "protocol": "https", "host": [ "bedrock", "us-west-2", "amazonaws", "com" ], "path": [ "model", "ai21.j2-mid", "invoke" ] } }, "response": [] } ], "auth": { "type": "awsv4", "awsv4": [ { "key": "service", "value": "", "type": "string" }, { "key": "region", "value": "", "type": "string" }, { "key": "secretKey", "value": "", "type": "string" }, { "key": "accessKey", "value": "", "type": "string" } ] }, "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ] }
Rest assured, we will continue to collaborate with AWS on this matter.
Best,
Trong
Hello Sathish,
I wanted to inform you that we were able to identify the root cause of the problem. The error that you faced is linked to the invocation endpoint. The endpoint had changed after Amazon Bedrock became generally available, effectively invalidating the Amazon Bedrock Connector. Our team acknowledges this and is actively working on releasing an updated version of the Amazon Bedrock Connector to address this and ensure it invokes the correct endpoints.
To receive a notification when we release this new iteration you can hit the "Save and Get Notified" button on the marketplace listing.
Best,
Trong
Hi Trong,
Thanks for the update. After downloading the new release I could able to get the successful response and the models are working fine as expected.
Thanks and Regards,
Sathish Kumar