Usman Mahmood
Usman Mahmood

Reputation: 711

Create and connect s3 with ec2 instance

I want to create an s3 bucket and then attach/mount it with a ec2 instance. I did the same for an ebs.

For ebs there were commands which would do things like to create an ebs the command was
ec2-create-volume --size 80 --availability-zone us-east-1a

For attach it to ec2 the command was

ec2-attach-volume volume_id -i instance_id -d device

and similarly there was a command to make ebs available for use

Now I want to do the same with s3.

But I cannot find commands like the commands were available for ebs.

Can some one tell me these commands? Or tell me some other way to do this. I don't want to do this through clicks made on the website.

Actually I want a java program to do all this. So If I know the commands , I can simply call that commands from java code. If there is a java code already available , then that would work for me as well

Hope any one can help me!

P.S I am very new to this thing, so detail explanation would help me very much ! Thank you all.

Upvotes: 4

Views: 8006

Answers (1)

Charles Engelke
Charles Engelke

Reputation: 5649

S3 bucket's aren't random access devices like EBS volumes. They can't be "attached" to an instance or used as a disk volume. They are a blob-storage service only accessible via the S3 API. Your EC2 instance (or your own PC, or any other device) can access your bucket so long as it uses the API (in any language) and has AWS credentials with permission to do so.

Upvotes: 4

Related Questions