Hi Matt Hargenrader,
For the ConverseStream, the service in the builder should be 'bedrock' (as you have it). This leads to the host being generated as 'https://bedrock.us-east-1.amazonaws.com', however ConverseStream needs to have the host 'https://bedrock-runtime.us-east-1.amazonaws.com' So you could overwrite the $SigV4Headers/Host you are using in the REST call with 'https://bedrock-runtime.us-east-1.amazonaws.com'.
Please let me know if this solved your problem.
Best regards,
Daan
Hi Daan,
Thank you for your response and feedback.
I was in contact with someone from the Mendix team, and they advised the same thing and to set up the SigV4Builder as follows:
When I followed the above implementation, coupled with overwriting the Host header in the REST activity, the 403 Forbidden (i.e., signature mismatch) error was seemingly resolved, but I did receive a 400 Bad Request error instead.
This recommended solution makes sense, but I think something else is causing the signature mismatch error. If you look at the Java source code for the GetSigV4Headers action within the AWS Authentication module, the Host header is calculated as follows:
The getSubDomain method actually defaults to the ServiceName value if the SubDomain member is either null or empty, as seen below:
With this in mind, it seems the proper approach is to add the SubDomain member to the SigV4Builder (i.e., "bedrock-runtime"), which properly calculates the Host header, but as stated previously, this still results in a 403 Forbidden error.
Please let me know if you have any other ideas.
Best regards,
Matt
Hi ,
Are you able to resolve this issue. If yes , please give me the details how it was. I am also facing this same issue. But I am able to execute Retrieve API , but not Invoke and converse APIs.