Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a file with string on s3 using aws command

I want to create a file with a string on s3 using the aws command, i cannot find such a thing in aws cli documentation, has anyone came across such thing ?

like image 835
Madhu Avinash Avatar asked Dec 23 '22 04:12

Madhu Avinash


1 Answers

The aws s3 cp command can take input from stdin:

echo Hello | aws s3 cp - s3://my-bucket/foo.txt

It can also send content to stdout:

aws s3 cp s3://my-bucket/foo.txt -

See:

  • AWS Command line: S3 content from stdin or to stdout | Loige
  • Bottom of this page: cp — AWS CLI Command Reference
like image 106
John Rotenstein Avatar answered Jan 17 '23 09:01

John Rotenstein