Example 1
$params = @{
"ResourceUri"="https://cdn.example.com/index.html"
"KeyPairId"="AKIAIOSFODNN7EXAMPLE"
"PrivateKeyFile"="C:\pk-AKIAIOSFODNN7EXAMPLE.pem"
"ExpiresOn"=(Get-Date).AddHours(1)
}
New-CFSignedUrl @params
Creates a signed url to the specified resource using a canned policy. The url will be valid for one hour. A System.Uri object containing the signed url is emitted to the pipeline.
Example 2
$start = (Get-Date).AddHours(24)
$params = @{
"ResourceUri"="https://cdn.example.com/index.html"
"KeyPairId"="AKIAIOSFODNN7EXAMPLE"
"PrivateKeyFile"="C:\pk-AKIAIOSFODNN7EXAMPLE.pem"
"ExpiresOn"=(Get-Date).AddDays(7)
"ActiveFrom"=$start
}
New-CFSignedUrl @params
Creates a signed url to the specified resource using a custom policy. The url will be valid starting in 24 hours and will expire one week later.
Example 3
$start = (Get-Date).AddHours(24)
$params = @{
"ResourceUri"="https://cdn.example.com/index.html"
"KeyPairId"="AKIAIOSFODNN7EXAMPLE"
"PrivateKeyFile"="C:\pk-AKIAIOSFODNN7EXAMPLE.pem"
"ExpiresOn"=(Get-Date).AddDays(7)
"ActiveFrom"=$start
"IpRange"="192.0.2.0/24"
}
New-CFSignedUrl @params
Creates a signed url to the specified resource using a custom policy. The url will be valid starting in 24 hours and will expire one week later. Access to the resource is restricted to the specified ip range.