🚀
This Go project provides a simple and efficient way to download files from an Amazon S3 bucket. It leverages the AWS SDK for Go to interact with S3 and download specified files.
- Go 1.20 or higher , download here
- AWS account with access to S3 ,check this repo
- AWS credentials configured (either through environment variables or shared credentials file)
- AWS credentials set up either in ~/.aws/credentials or as environment variables.
-
Clone the repository:
git clone https://github.com/Adesoji1/s3-file-downloader.git
-
Navigate to the project directory:
cd s3-file-downloader
-
Navigate to the working directory:
cd s3-file-downloader/goerl
-
Install the required dependencies:
go mod init goerl
go mod tidy
-
Modify the
bucketName
andfiles
variables ingoerl/download_files_in_known_bucket.go
to match your S3 bucket and the files you want to download. -
TO Connect to any s3bucket to download, use
https://github.com/Adesoji1/s3-file-downloader/tree/main/goerl/download_data.go
-
Run the program and 🔱 the repo:
go run download_data.go
-
AWS Session: The code creates an AWS session using shared credentials or environment variables.
-
S3 Client and Downloader: An S3 client is created, followed by a downloader that leverages the client to download files.
-
File Download Loop: The code iterates through a list of specified files, creating a local file for each, and then downloading the corresponding file from S3.
-
Error Handling: Proper error handling is implemented to gracefully handle any issues that may arise during the download process.
Feel free to fork the project, make changes, and submit a pull request. Contributions are welcome!
This project is licensed under the MIT License - see the LICENSE.md file for details.
- AWS SDK for Go
- All the contributors who make open-source such a beautiful place!
Made with ❤️ by Adesoji Alu