Skip to content

aws.s3.read

aws · scripts/+aws/+s3/read.m

: data = aws.s3.read (bucket, key)

Read an object from Amazon S3 and return its raw bytes as a column uint8 vector.

Credentials and region come from the environment variables used by MATLAB cloud storage access: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, optional AWS_SESSION_TOKEN, and optional AWS_DEFAULT_REGION (default "us-east-1"). An optional custom endpoint may be set with AWS_ENDPOINT_URL (or AWS_S3_ENDPOINT / NEXUS_AWS_S3_ENDPOINT) for MinIO or local test servers.

Missing credentials raise MATLAB:aws:s3:MissingCredentials. A missing object raises MATLAB:FileIO:InvalidRemoteLocation.