Generate AWS S3 (or compatible) presigned URLs from the command line in Python, Java, C# or Powershell.
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>]
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>]
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>]
--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)
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.
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.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.