MATLAB: Can’t I access the S3 bucket on some machines while I can access it on other machines

bucketfiledatastorefoundMATLABnots3

The customer is trying to access the S3 bucket that they have created. They are able to access the file using the aws-cli but when they try to access the bucket from MATLAB using the "fileDatastore" command they are unable to do so.

Best Answer

It seems that the "setenv" function did not set the "AWS_REGION" environment variable for them. This was verified using the following command:
>> java.lang.System.getenv('AWS_REGION')
ans = []
Please not that you should define "AWS_DEFAULT_REGION" in MATLAB R2020b and later versions. For details, please refer the documentation for the release that you are using.
・Working with Remote Data