Powershell cmdlet for Amazon AWS Glacier

I know how to push a file up to S3 using Powershell, but now I want to push a file directly to Glacier, how is that done in Powershell?
Ed WalshSenior Director of Applications and Cloud ServicesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
Try this :
Add-Type -Path "C:\Program Files (x86)\AWS SDK for .NET\BIN\AWSSDK.dll"

$Region="yyyyyyyyyyyyy"
$Vault="VaultName"
$Desc="File Description"
$File="d:\Temp\File.txt"
$Accesskey="xxxxxxxx"
$Secretkey="xxxxxxxxxx"

$Endpoint = [Amazon.RegionEndpoint]::GetBySystemName($Region)
$manager = New-Object -TypeName Amazon.Glacier.Transfer.ArchiveTransferManager($Accesskey,$Secretkey,$Endpoint)
$manager.Upload($Vault, $Desc, $File).ArchiveId

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ed WalshSenior Director of Applications and Cloud ServicesAuthor Commented:
There is no Powershell cmdlet for this like there is for S3, you need to use .NET dll's?
0
Ed WalshSenior Director of Applications and Cloud ServicesAuthor Commented:
Getting error it can't find AWSSDK.dll, This Powershell script will run on a AWS Windows 2012 R2 Instance. Would that dll be already on the instance or do you need to install the dll?
0
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
you need to download the SDK if not on your system for this and try
From here:
https://aws.amazon.com/sdk-for-net/
0
Ed WalshSenior Director of Applications and Cloud ServicesAuthor Commented:
Ok, got it working on my AWS Server and didn't need to install the SDK you mentioned.
Usually AWS Instances come with the SDK already installed, from what it looks like. But the path you gave me didnt exist,
Add-Type -Path "C:\Program Files (x86)\AWS SDK for .NET\BIN\AWSSDK.dll"
but I did find a DLL that looked like it should work, so leaving your script the same just changing path to this DLL and it worked just fine,
Add-Type -Path "C:\Program Files (x86)\AWS SDK for .NET\bin\Net35\AWSSDK.Glacier.dll"

However you deserve the solution win as you steered me down the correct path.
Shame though that Amazon doesnt have a cmdlet for Glacier like they do for S3.

Thanks Raheman.

-Ed W.
0
Ed WalshSenior Director of Applications and Cloud ServicesAuthor Commented:
Website requires I give a reason why I selected one of my own comments as part of the solution.  I did that so any future readers see that the dll and path given by Raheman didn't work for me and show what path and dll did work for me, however Raaheman script worked just fine when poiting to the correct DLL so he deserves the credit for a solution.

Thanks again Raheman, I appreciate you answering my question.

-Ed W.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
AWS

From novice to tech pro — start learning today.