1

I have a file that is stored on AWS s3 at https://xyz.s3.amazonaws.com/foo/file.json and I want to download that into my local machine using Python. However, the URL cannot be accessed publicly. I have the Account ID, IAM user name, and password (but NO Access Key or Secret Access Key and no permissions to view/change them either) to the resource that contains this file. How can I programmatically download this file instead of doing so from the console?

angryweasel
  • 316
  • 2
  • 10
  • 3
    Since Access Key or Secret Access Key are required for programatic access, I think you are only left with using AWS console. – Marcin Jun 29 '21 at 11:50
  • Why do you need to use python to do this? aside from logging into the console you'd need to move it somewhere you do have access to it, unless you have permission to change the permissions needed to access that file publically – Sayse Jun 29 '21 at 11:51

1 Answers1

1

You could generate an Amazon S3 pre-signed URL, which would allow a private object to be downloaded from Amazon S3 via a normal HTTPS call (eg curl). This can be done easily using the AWS SDK for Python, or you could code it yourself without using libraries. Answer by John Rotenstein here

Effie
  • 191
  • 1
  • 5