Upload files or directories to S3 and generate CloudFront Signed URLs for 7-day download links.
To use a custom domain, you also need:
- A Route53 hosted zone for your domain
git clone <repo-url>
cd sharelink
# 1. Create config file
cp infra/terraform.tfvars.example infra/terraform.tfvars
vi infra/terraform.tfvars # Edit to match your environment
# 2. Install
./install.sh# Required
aws_region = "ap-northeast-2"
bucket_name = "my-sharelink-files" # Must be globally unique
# Custom domain (optional)
use_custom_domain = true
domain_name = "sharelink.example.com"
route53_zone_name = "example.com"Without a custom domain, ShareLink uses the default CloudFront domain (*.cloudfront.net).
# Share a single file
sharelink ./report.pdf
# Share a directory (automatically zipped)
sharelink ./documents/Example output:
Uploading report.pdf to s3://my-sharelink-files/a1b2c3d4_report.pdf ...
Upload complete.
ShareLink (valid for 7 days):
https://d1234abcdef.cloudfront.net/a1b2c3d4_report.pdf?Expires=...&Signature=...&Key-Pair-Id=...
| Resource | Description |
|---|---|
| S3 Bucket | File storage with 7-day auto-expiration |
| CloudFront | HTTPS distribution, S3 access restricted via OAC |
| CloudFront Key Group | Public key for Signed URL verification |
| ACM (optional) | TLS certificate for custom domain |
| Route53 (optional) | DNS A record for custom domain |
cd infra
terraform destroy
sudo rm /usr/local/bin/sharelink