AWS S3 help - context

Hi there.

I’m trying to make use of AWS S3 for image storage.
I looked at the O-Fish example:

I have:

  1. Created an AWS account
  2. Created an ‘IAm’ user
  3. Followed the guide when creating a DataLake (setting up a role though AWS Shell)
  4. Create a ‘Third party service’ of type AWS

When i invoke the function through console- or when saving my object from a client -it cannot find the region from context.
I made a logstatement that prints out the context and it’s empty - no region.

A thing worth mentioning is that i did not use AWS Cli because i for some reason cannot run it on my computer - instead i used the AWS Shell from web to sign the iAm user.

Any suggestions?
How do i test if the service i set up can actually connect to my S3 bucket?

This is the code i use to connect to the S3 (code from O-Fish project)

Hi @Rasmus_B – Regarding this code snippet:

context.values.get("eu-central-1")

It is attempting to read the value from a Realm value named eu-central-1 – do you have a value with that name (or does it have a different name, where the value is set to eu-central-1?)

Hi @Andrew_Morgan

No - when i print out the context object, so such value is present , but i have also tried hardcoding the value into the .s3 fuction, but no luck.

The reason i write ‘eu-central-1’ is because it is where bucket is placed

Anyone? I’ts probably a minor thing but i’m kinda stuck…

That code is trying to read a Realm Value with that name. If you haven’t created that Value then it will fail. See the docs for how to define the value https://docs.mongodb.com/realm/values-and-secrets/

Then i simply do not understand how to connect to the S3 - i followed the guide, and hardcoded the value - same result

Can you share the code where you hard code the region. Also, what logs are you seeing from the Realm app and from the AWS console?

I got past the issue, but when making put call to S3 i get this error:
FunctionError: SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method. status code: 403

I have tried varous formats for the key (name of the file):
somename
somename.jpeg
/media/somemedia.jpeg