Skip to content

Generate AWS S3 (or compatible) presigned URLs from the command line in Python, Java, C# or Powershell.

License

Notifications You must be signed in to change notification settings

swedwise/Bucketeer

Repository files navigation

Bucketeer

Generate AWS S3 (or compatible) presigned URLs from the command line in Python, Java, C# or Powershell.

Python

This uses only Python standard library components.

Requirements:

  • Python 3.7+

Run:

python bucketeer.py --access-key <key> --secret-key <key> --region <region> --bucket <bucket> --object-key <key> [--host <host>] [--expires <seconds>]

Java

Requirements:

  • Java 8+

Build:

javac Bucketeer.java

Run:

java Bucketeer --access-key <key> --secret-key <key> --region <region> --bucket <bucket> --object-key <key> [--host <host>] [--expires <seconds>]

C#

Requirements:

  • .NET 6.0+ SDK

Build:

dotnet build Bucketeer/Bucketeer.csproj

Run:

dotnet run --project Bucketeer -- --access-key <key> --secret-key <key> --region <region> --bucket <bucket> --object-key <key> [--host <host>] [--expires <seconds>]

Parameters for Python, Java and C# versions

  • --access-key (required): AWS access key ID
  • --secret-key (required): AWS secret access key
  • --region (required): AWS region (e.g., us-east-1)
  • --bucket (required): S3 bucket name
  • --object-key (required): S3 object key
  • --host (optional): Custom S3 host (for S3-compatible storage, e.g. StorageGrid)
  • --expires (optional): Expiration in seconds (default: 3600)

Powershell

Import the module with

Import-Module .\Bucketeer.psm1

and execute the Get-S3PresignedUrl function contained therein:

Get-S3PresignedUrl -AccessKey "AKIA..." -SecretKey "SECRET..." -Region "us-east-1" -Bucket "mybucket" -ObjectKey "file.txt"

The Host parameter is called CustomHost in the Powershell version, since $Host is a reserved varable.

Development

This project is developed in Python, Java, C#, and Powershell. Each language has its own directory with the source code. The Python version is the most complete and is used as the reference implementation. The Java, C#, and Powershell versions are written with the Python solution as a template.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

About

Generate AWS S3 (or compatible) presigned URLs from the command line in Python, Java, C# or Powershell.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published