Not able to upload file to aws s3 using shell script

时光毁灭记忆、已成空白 提交于 2019-12-02 07:18:28

Install AWS CLI from link given below

Configure AWS by aws configure command and enter keys and region

To copy file to S3 use this command in shell script

aws s3 cp fileName s3://bucketName

Link: http://docs.aws.amazon.com/cli/latest/userguide/installing.html#install-bundle-other-os

p.s If you receive connection timed out error open port 443 (HTTPS) in security group.

Please follow the below steps,

Create one IAM user with the permission to upload files in s3 bucket.

Note: You can also create a policy where you can access all the s3 buckets available in your region and you can attach the policy to the user that u have created in IAM for uploading files in S3 bucket

Make a note of your access and secret key for the IAM user.

Login in to your server for example [Aws linux server]

use the following command

aws configure

enter the access key enter the secret key enter the region for example if it is mumbau region use ap-south-1 enter the output as "text"

after this you are ready to upload files from your server to s3 bucket.

use the example command for uploading files in s3 bucket

aws s3 cp or mv fileName s3://bucketName

The above aws cli can be used in script for uploading files.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!