0

I am trying to download files from s3 to ec2 instance in Azure DevOps by using AWS CLI in Build Pipeline. I am able to get the download logs but the data is not downloaded on my ec2 instance.

Same command works while executing from EC2 instance. It doesn't give me any error from DevOps but I do not see the data moved to my instance.

Thanks for your help.

Log Screenshot

Command Used

Krzysztof Madej
  • 32,704
  • 10
  • 78
  • 107
  • Hi @Monika Nanda. Is there any update about this ticket? Feel free to let me know if the answers could give you some help. Just a remind of [this](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work). – Kevin Lu-MSFT Oct 26 '20 at 03:13
  • Thanks for replying. I tried this but I am getting Invalid Instanceid error. But I checked my instance id is correct. Not sure if there are special permission for ssm operations. – Monika Nanda Oct 27 '20 at 04:41
  • Hi Monika. You could check if the [SSM Agent](https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-agent.html) has been installed. Please refer to [this ticket](https://stackoverflow.com/a/47036168/13464420) for more methods to solve this issue. – Kevin Lu-MSFT Oct 27 '20 at 05:17
  • Thank you, this helped. – Monika Nanda Oct 28 '20 at 16:10

1 Answers1

1

You could refer to this ticket:

The AWS CLI calls the AWS API. The APIs for Amazon S3 do not have the ability to interact with the operating system on an Amazon EC2 instance.

So when you run the same command in the EC2 instance, it could work as expected. But it doesn't work in Azure Devops Pipeline.

You could try to use the aws cli send-command to send the aws s3 cp command to the EC2 instance.

Here is an example:

enter image description here

Kevin Lu-MSFT
  • 20,786
  • 3
  • 19
  • 28