Monday, June 21, 2010

How to create signed URLs with PowerShell and CloudBerry S3 Explorer

Note: this post applies to CloudBerry Explorer 1.9.1 and later.

Every so often you may want to automate generating signed URLs for Amazon S3 or CloudFront and CloudBerry Explorer PowerShell command line interface provides you with an option to do just that. .

Generating Web URLs
Using Get-CloudUrl command you can generate HTTP, HTTPS or RTMP URLs and also HTML code for streaming video files.

EXAMPLE 1: Generating short URL for JPG files and save output to a file


$dest | Get-CloudUrl -Filter *.jpg -Type HTTP -ChilpIt >> C:\urls.txt

EXAMPLE 2: Generating signed URL


$dest | Get-CloudUrl -Filter *.jpg -Type HTTPS -Expire 01/01/2011 >> C:\urls.txt

EXAMPLE 3: Generating CloudFront signed URL (where $domain is a CloudFront distribution domain name)


$dest | Get-CloudUrl -Filter *.jpg -Type HTTP -Expire 01/01/2011 -DomainName $domain>> C:\urls.txt

EXAMPLE 4: Generate signed URL for private content item (where $domain is Streaming distribution domain name)


$policy = New-CloudPolicy -PrivateKey $privatekey -KeyPairId $keypairid -IsCanned
$dest | Get-CloudUrl -Filter *.flv -Type RTMP -Policy $policy -Expire 01/01/2011 -DomainName $domain >> C:\urls.txt

CloudBerry S3 Explorer is a Windows freeware product that helps managing Amazon S3 storage and CloudFront . You can download it at http://cloudberrylab.com/

CloudBerry S3 Explorer PRO is a Windows program that helps managing Amazon S3 storage and CloudFront . You can download it at http://pro.cloudberrylab.com/ It is priced at $39.99

Like our products? Please help us spread the word about them. Learn here how to do it.

0 comments: