Download an object from S3 in a run document

0

We have a role attached to a managed instance for ssm. It has rights to a private S3 bucket and it's contents.

Do I have to do anything special in order to download a file using it's S3 url? Do I have to state in the run document to assume the role, or is it already implied?

질문됨 5년 전1140회 조회
1개 답변
0

Figured this out. The managed instance had the correct role, I just needed to install the awscli tools first, set the path so that powershell could use them, then issue the standard aws s3 cp command.

Part of my run document looks like this. I'm using chocolatey to get the awscli tools installed.
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install awscli -y
setx PATH "%PATH%;C:\Program Files\Amazon\AWSCLI"
aws s3 cp s3://yadayadayada c:\
then a line to remove the cli tool when done
choco uninstall awscli -y

Too bad the ssm agent doesn't come with aws tools already installed for this kind of stuff, but that's ok.

Edited by: kleinberger on Feb 13, 2019 2:13 PM

답변함 5년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠