amazon web services for java developers

Post on 10-May-2015

6.887 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Overview of Amazon Web Services. Tools to get started. Java libraries to manage AWS infrastructure.

TRANSCRIPT

Amazon Web Servicesfor Java developers

Filippo Diotalevifilippo@diotalevi.comtwitter.com/fdiotalevi

Amazon Web Services

How to start

deployscale

Java APIs

Amazon Web Services

EC2Elastic Computer Cloud

http://aws.amazon.com/ec2/

EBSElastic Block Storage

http://aws.amazon.com/ebs

S3Simple Storage Service

http://aws.amazon.com/s3/

SimpleDB

http://aws.amazon.com/simpledb/

SQSSimple Queue Service

http://aws.amazon.com/sqs/

ELBElastic Load Balancing

http://aws.amazon.com/elb/

RDSRelational Database Service

http://aws.amazon.com/rds/

CloudFrontContent Delivery Network

http://aws.amazon.com/cloudfront/

How to start

deployscale

aws.amazon.com

Access Key, Secret Key

Certificate

S3 Organizer

http://www.s3fox.com

Decaf

http://decaf.9apps.net

Choose/Make your AMI

Start it !

Javaday.Photos

javaday.photoweb application

EC2 Instance

Amazon S3

JavadayphotoBucket

Scale it

javaday.photoweb application

EC2 Instance

Amazon S3

JavadayphotoBucket

javaday.photoweb application

EC2 Instance

Elastic Load Balancer

Java APIs

typica

http://code.google.com/p/typica

SQSEC2

SimpleDB

Jec2 ec2 = new Jec2(AWSAccessKeyId, SecretAccessKey);

// describe imagesList<String> params = new ArrayList<String>();List<ImageDescription> images = ec2.describeImages(params);for (ImageDescription img : images) { if (img.getImageState().equals("available")) { log.info(img.getImageId()+"\t"+img.getImageLocation() +"\t"+img.getImageOwnerId()); }}

// describe instancesparams = new ArrayList<String>();List<ReservationDescription> instances = ec2.describeInstances(params);for (ReservationDescription res : instances) { log.info(res.getOwner()+"\t"+res.getReservationId()); if (res.getInstances() != null) { for (Instance inst : res.getInstances()) { log.info("\t"+inst.getImageId()+"\t"+inst.getDnsName() +"\t"+inst.getState()+"\t"+inst.getKeyName()); } }}

jets3t

http://jets3t.s3.amazonaws.com/index.html

S3

String key = "<my-key>"; String secret = "<secret>"; String bucket = "<bucket-name>"; S3Service s3Service; public Storage() throws S3ServiceException { AWSCredentials awsCredentials = new AWSCredentials(key, secret); s3Service = new RestS3Service(awsCredentials); }

public void listBuckets() throws S3ServiceException { S3Bucket[] myBuckets = s3Service.listAllBuckets(); for (S3Bucket bucket : myBuckets) System.out.println(bucket.getName()); }

public void storeFile(File f) throws S3ServiceException { S3Bucket photoBucket = getPhotoBucket(); S3Object obj = new S3Object(); obj.setAcl(AccessControlList.REST_CANNED_PUBLIC_READ); obj.setDataInputFile(f); obj.setKey(""+System.currentTimeMillis()+"-"+f.getName()); //.... s3Service.putObject(photoBucket, obj); }

jclouds

http://code.google.com/p/jclouds

S3EC2GAE

Rackspace

Try it!aws.amazon.com

http://www.knokode.com/aws4java.pdf

Get it!

photo credits

http://www.sxc.hu/photo/1078164 http://www.sxc.hu/photo/599892http://www.istockphoto.com/stock-photo-6331752-spring.php

http://www.istockphoto.com/stock-photo-2121515-drowning-in-money.php

http://www.sxc.hu/photo/992832http://www.istockphoto.com/

stock-photo-8290194-blank-folder-with-scoring.phphttp://www.istockphoto.com/stock-photo-8298979-pill.php http://www.sxc.hu/photo/1216018

http://www.sxc.hu/photo/1144347 http://www.sxc.hu/photo/1237136 http://www.sxc.hu/photo/845473 http://www.sxc.hu/photo/998524

http://www.sxc.hu/photo/1236960

top related