Create and Upload static objects in aws S3 bucket using AWS-CLI

Lets Create a bucket and upload our data in S3 service of AWS uding CLI.

First we have to create a bucket.
At First our S3 will be empty

Use Command aws s3api create-bucket --bucket bucketname --region regionname --create-bucket-configuration LocationConstraint=regionname --acl public-read
Note- Here we can use only aws s3 mb to create a bucket instead of region but if you want it to be in a specific region that command can be used.

Note- Here we use --acl to make it public. If you want to give permissions afterwards the you can use options 
aws s3api put-bucket-acl --bucket bucketname --acl public-read


Here our bucket is created

Now, Our bucket is created ans we have to upload objects in it.
Here Our bucket is empty

Use command aws s3api put-object --bucket bucketname --body objectdata --key objectname --acl public-read


Here Our image is uploaded
We can view it in our html page.


Thank You for reading.

I would like to thanks Vimal Daga Sir.

My Email — ayanchawlae@gmail.com


Comments

Popular posts from this blog

Key Announcements at Microsoft Ignite

Ansible Handlers

Ansible Roles (Httpd + Haproxy)