Amazon Web Services for Java developers

7,941 views

Published on

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

Published in: Technology, Design
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
7,941
On SlideShare
0
From Embeds
0
Number of Embeds
45
Actions
Shares
0
Downloads
195
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Amazon Web Services for Java developers

  1. 1. Amazon Web Services for Java developers Filippo Diotalevi filippo@diotalevi.com twitter.com/fdiotalevi
  2. 2. Amazon Web Services
  3. 3. How to start deploy scale
  4. 4. Java APIs
  5. 5. Amazon Web Services
  6. 6. EC2 Elastic Computer Cloud http://aws.amazon.com/ec2/
  7. 7. EBS Elastic Block Storage http://aws.amazon.com/ebs
  8. 8. S3 Simple Storage Service http://aws.amazon.com/s3/
  9. 9. SimpleDB http://aws.amazon.com/simpledb/
  10. 10. SQS Simple Queue Service http://aws.amazon.com/sqs/
  11. 11. ELB Elastic Load Balancing http://aws.amazon.com/elb/
  12. 12. RDS Relational Database Service http://aws.amazon.com/rds/
  13. 13. CloudFront Content Delivery Network http://aws.amazon.com/cloudfront/
  14. 14. How to start deploy scale
  15. 15. aws.amazon.com
  16. 16. Access Key, Secret Key Certificate
  17. 17. http://developer.amazonwebservices.com/connect/entry.jspa?externalID=609 ElasticFox
  18. 18. S3 Organizer http://www.s3fox.com
  19. 19. Decaf http://decaf.9apps.net
  20. 20. Choose/Make your AMI
  21. 21. Start it !
  22. 22. Javaday.Photos
  23. 23. javaday.photo web application EC2 Instance Javaday photo Bucket Amazon S3
  24. 24. Scale it
  25. 25. Elastic Load Balancer javaday.photo javaday.photo web application web application EC2 Instance EC2 Instance Javaday photo Bucket Amazon S3
  26. 26. Java APIs
  27. 27. typica SQS EC2 SimpleDB http://code.google.com/p/typica
  28. 28. Jec2 ec2 = new Jec2(AWSAccessKeyId, SecretAccessKey); // describe images List<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 instances params = 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()); } } }
  29. 29. jets3t S3 http://jets3t.s3.amazonaws.com/index.html
  30. 30. 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); }
  31. 31. jclouds S3 EC2 GAE Rackspace http://code.google.com/p/jclouds
  32. 32. Try it! aws.amazon.com
  33. 33. Get it! http://www.knokode.com/aws4java.pdf
  34. 34. http://www.istockphoto.com/ http://www.istockphoto.com/ http://www.sxc.hu/photo/1078164 http://www.sxc.hu/photo/599892 stock-photo-6331752-spring.php stock-photo-2121515-drowning-in-money.php http://www.istockphoto.com/ http://www.istockphoto.com/ http://www.sxc.hu/photo/992832 stock-photo-8298979-pill.php stock-photo-8290194-blank-folder-with-scoring.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 photo credits

×