Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Hands-on in the AWS Java Ecosystem (DEV325-R1) - AWS re:Invent 2018

494 views

Published on

The AWS SDK for Java 2.0 includes a number of new features and performance improvements. Using real code examples, we'll build a serverless application that makes use of the SDKs new HTTP2-based event-streaming APIs and deploy it using AWS Java tooling introduced in 2018. You'll learn what's new in 2.0 and the benefits of upgrading, as well as how to take advantage of new tooling in AWS's already rich Java ecosystem.

  • Be the first to comment

Hands-on in the AWS Java Ecosystem (DEV325-R1) - AWS re:Invent 2018

  1. 1. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Hands-on in the AWS Java Ecosystem Kyle Thomson Senior Software Developer AWS SDKs and Tools D E V 3 2 5 Sam Fink Software Developer AWS SDKs and Tools
  2. 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS JVM Ecosystem AWS SDK for Java Kinesis Consumer Library Kinesis Producer Library Kinesis S3 Transfer Manager S3A Hadoop FS S3 Encryption Client Amazon S3 DynamoDB Mapper DynamoDB Document API DynamoDB Encryption Client Amazon DynamoDB DynamoDB Accelerator (DAX) Client SWF Flow Library Step Functions DSL Workflow Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs SQS Extended Client Library IAM Policy DSL Java Mail Client for SES Other Code Deployment AWS CodeStar AWS CodeDeploy AWS CodePipeline Execution Environments AWS Elastic Beanstalk AWS Lambda Amazon EMR Amazon ECSAmazon EC2 Ships with SDK (v1) AWS Open Source 3rd Party Open Source AWS Services Legend Ships with SDK (v2)
  3. 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS SDK for Java Kinesis Consumer Library Kinesis Producer Library Streaming Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs Execution Environments AWS Elastic Beanstalk AWS Lambda Amazon EMR Amazon ECSAmazon EC2 Ships with SDK (v1) AWS Open Source 3rd Party Open Source AWS Services Legend Ships with SDK (v2) S3 Transfer Manager S3A Hadoop FS S3 Encryption Client Amazon S3 DynamoDB Mapper DynamoDB Document API DynamoDB Encryption Client Amazon DynamoDB DynamoDB Accelerator (DAX) Client SWF Flow Library Step Functions DSL Workflow SQS Extended Client Library IAM Policy DSL Java Mail Client for SES Other Code Deployment AWS CodeStar AWS CodeDeploy AWS CodePipeline
  4. 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS SDK for Java Ships with SDK (v1) AWS Open Source 3rd Party Open Source AWS Services Legend Ships with SDK (v2) Kinesis Consumer Library Kinesis Producer Library Streaming Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs Execution Environments AWS Elastic Beanstalk AWS Lambda Amazon EMR Amazon ECSAmazon EC2
  5. 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS SDK for Java Ships with SDK (v1) AWS Open Source 3rd Party Open Source AWS Services Legend Ships with SDK (v2) Kinesis Consumer Library Kinesis Producer Library Streaming Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs Execution Environments AWS Elastic Beanstalk AWS Lambda Amazon EMR Amazon ECSAmazon EC2 Toolkit for JetBrains
  6. 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  7. 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Toolkit for JetBrains • Meeting developers where they are • IntelliJ • PyCharm • Broad ecosystem • WebStorm • Clion • RubyMine • Rider • AppCode • GoLand
  8. 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Installation • Currently developer-preview • EAP channel on the JetBrains plugin repository • https://plugins.jetbrains.com/plugin/11349-aws-toolkit • Build from source > git clone https://github.com/aws/aws-toolkit-jetbrains.git > cd aws-toolkit-jetbrains > ./gradlew buildPlugin
  9. 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  10. 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  11. 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  12. 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Focus • Serverless • AWS Lambda • AWS SAM CLI Integration • Local debugging • Basic resource/credential management • Coming soon: Serverless Application support
  13. 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Open Source First • Developer preview available on the JetBrains plugin repository • https://plugins.jetbrains.com/plugin/11349-aws-toolkit • Developing in the open • Publicly available backlog • https://github.com/aws/aws-toolkit-jetbrains/projects • Open-source : https://github.com/aws/aws-toolkit-jetbrains • We need you!
  14. 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS SDK for Java Ships with SDK (v1) AWS Open Source 3rd Party Open Source AWS Services Legend Ships with SDK (v2) Kinesis Consumer Library Kinesis Producer Library Streaming Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs Execution Environments AWS Elastic Beanstalk AWS Lambda Amazon EMR Amazon ECSAmazon EC2 Toolkit for JetBrains
  15. 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS SDK for Java (v2) AWS SDK for Java (v1) AWS SDK for Java Ships with SDK (v1) AWS Open Source 3rd Party Open Source AWS Services Legend Ships with SDK (v2) Kinesis Consumer Library Kinesis Producer Library Streaming Execution Environments AWS Elastic Beanstalk AWS Lambda Amazon EMR Amazon ECSAmazon EC2 Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs Toolkit for JetBrains
  16. 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Ships with SDK (v1) AWS Open Source 3rd Party Open Source AWS Services Legend Ships with SDK (v2) Kinesis Consumer Library Kinesis Producer Library Streaming Execution Environments AWS Elastic Beanstalk AWS Lambda Amazon EMR Amazon ECSAmazon EC2 Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs Toolkit for JetBrains AWS SDK for Java (v1) AWS SDK for Java (v2)
  17. 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  18. 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. SnsClient.builder() .region(Region.US_WEST_2) .httpClient(UrlConnectionHttpClient.create()) .build(); SnsClient.builder() .region(Region.US_WEST_2) .overrideConfiguration( ClientOverrideConfiguration.builder() .apiCallTimeout(Duration.ofSeconds(5)) .build()) .build(); SnsClient.builder() .region(Region.US_WEST_2) .overrideConfiguration(o -> o.apiCallTimeout(Duration.ofSeconds(5))) .build(); SnsAsyncClient.create() SnsClient.builder() .region(Region.US_WEST_2) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); AWS Java SDK v2 Recap Non-blocking Asynchronous Service Clients Immutability through Builder Pattern Pluggable HTTP Clients Consumer Builder Pattern
  19. 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Ships with SDK (v1) AWS Open Source 3rd Party Open Source AWS Services Legend Ships with SDK (v2) Kinesis Consumer Library Kinesis Producer Library Streaming Execution Environments AWS Elastic Beanstalk Amazon EMR Amazon ECSAmazon EC2 Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs Toolkit for JetBrains AWS SDK for Java (v1) AWS SDK for Java (v2) AWS Lambda
  20. 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Lambda and the AWS SDK for Java v2 How to get the best Lambda experience with the SDK Startup time of the SDK What did we change? URLConnection as http client Moved off of Jackson Object Mapper at runtime Generate resources at compile time Profile, profile, profile
  21. 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  22. 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS SDK for Java v2 Modularized Endpoint Discovery Client Cloud Client Cloud Cloud Cloud
  23. 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS SDK for Java v2 Modularized Endpoint Discovery HTTP/2 Event Streaming Fully Non-Blocking HTTP/2 Clients Bi-directional real-time streaming responses
  24. 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Ships with SDK (v1) AWS Open Source 3rd Party Open Source AWS Services Legend Ships with SDK (v2) Kinesis Consumer Library Kinesis Producer Library Streaming Execution Environments AWS Elastic Beanstalk Amazon EMR Amazon ECSAmazon EC2 Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs Toolkit for JetBrains AWS SDK for Java (v1) AWS SDK for Java (v2) AWS Lambda
  25. 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Ships with SDK (v1) AWS Open Source 3rd Party Open Source AWS Services Legend Ships with SDK (v2) Execution Environments AWS Elastic Beanstalk Amazon Elastic Map Reduce (EMR) Amazon EC2 Container Service (ECS) Amazon Elastic Compute (EC2) Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs Toolkit for JetBrains AWS SDK for Java (v1) AWS SDK for Java (v2) AWS Lambda Kinesis Consumer Library Kinesis Producer Library Streaming HTTP/2 Bi- Directional Streaming
  26. 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  27. 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS SDK for Java v2 GA as of 11/19 https://github.com/aws/aws-sdk-java-v2 https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/welcome.html KCL 2.0 Available Now https://github.com/awslabs/amazon-kinesis-client High-Level Libraries Coming Soon S3 Managed Multi-Part Uploads/Downloads DynamoDB ORM & Document Model IAM Policy Generation API Gateway Client Generation And More With Your Feedback!
  28. 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  29. 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  30. 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  31. 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Cloud Development Kit
  32. 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Ships with SDK (v1) AWS Open Source 3rd Party Open Source AWS Services Legend Ships with SDK (v2) Execution Environments AWS Elastic Beanstalk Amazon Elastic Map Reduce (EMR) Amazon EC2 Container Service (ECS) Amazon Elastic Compute (EC2) Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs Toolkit for JetBrains AWS SDK for Java (v1) AWS SDK for Java (v2) AWS Lambda Kinesis Consumer Library Kinesis Producer Library Streaming HTTP/2 Bi- Directional Streaming
  33. 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Ships with SDK (v1) AWS Open Source 3rd Party Open Source AWS Services Legend Ships with SDK (v2) Execution Environments AWS Elastic Beanstalk Amazon Elastic Map Reduce (EMR) Amazon EC2 Container Service (ECS) Amazon Elastic Compute (EC2) Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs Toolkit for JetBrains AWS SDK for Java (v1) AWS SDK for Java (v2) AWS Lambda Kinesis Consumer Library Kinesis Producer Library Streaming HTTP/2 Bi- Directional Streaming Cloud Development Kit (CDK)
  34. 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Infrastructure as code Higher-level abstractions Object oriented & extensible Native IDE support Open source https://github.com/awslabs/aws-cdk Currently in developer preview
  35. 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Simple CDK example Stack
  36. 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Simple CDK example Stack Queue queue = new Queue(this, "Queue", QueueProps.builder() .withVisibilityTimeoutSec(300) .build()); Topic topic = new Topic(this, "Topic", TopicProps.builder() .withDisplayName("Some Amazing Topic") .build());
  37. 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Simple CDK example
  38. 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Simple CDK example Queue queue = new Queue(this, "Queue", QueueProps.builder() .withVisibilityTimeoutSec(300) .build()); Topic topic = new Topic(this, "Topic", TopicProps.builder() .withDisplayName("Some Amazing Topic") .build()); topic.subscribeQueue(queue);
  39. 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Synthesized Template { "Resources": { "Queue4A7E3555": { "Type": "AWS::SQS::Queue", "Properties": { "VisibilityTimeout": 300 } }, "QueuePolicy25439813": { "Type": "AWS::SQS::QueuePolicy", "Properties": { "PolicyDocument": { "Statement": [ { "Action": "sqs:SendMessage", "Condition": { "ArnEquals": { "aws:SourceArn": { "Ref": "TopicBFC7AF6E" } } }, "Effect": "Allow", "Principal": { "Service": "sns.amazonaws.com" }, "Resource": { "Fn::GetAtt": [ "Queue4A7E3555", "Arn" ] } } ], "Version": "2012-10-17" }, "Queues": [{ "Ref": "Queue4A7E3555" }] } }, "TopicBFC7AF6E": { "Type": "AWS::SNS::Topic", "Properties": { "DisplayName": "Some Amazing Topic" } }, "TopicQueueSubscription2D098ED4": { "Type": "AWS::SNS::Subscription", "Properties": { "Endpoint": { "Fn::GetAtt": [ "Queue4A7E3555", "Arn" ] }, "Protocol": "sqs", "TopicArn": { "Ref": "TopicBFC7AF6E" } } } } }
  40. 40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Simplified Template "Queue4A7E3555": { "Type": "AWS::SQS::Queue", "Properties": { "VisibilityTimeout": 300 } }, "QueuePolicy25439813": { "Type": "AWS::SQS::QueuePolicy", "Properties": { "PolicyDocument": {...}, "Queues": [{ "Ref": "Queue4A7E3555" }] } }, "TopicBFC7AF6E": { "Type": "AWS::SNS::Topic", "Properties": { "DisplayName": "Some Amazing Topic" } }, "TopicQueueSubscription2D098ED4": { "Type": "AWS::SNS::Subscription", "Properties": { "Endpoint": {...}, "Protocol": "sqs", "TopicArn": { "Ref": "TopicBFC7AF6E" } } }
  41. 41. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Simple CDK example Queue queue = new Queue(this, "Queue", QueueProps.builder() .withVisibilityTimeoutSec(300) .build()); Topic topic = new Topic(this, "Topic", TopicProps.builder() .withDisplayName("Some Amazing Topic") .build()); topic.subscribeQueue(queue); Stack
  42. 42. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Related breakouts Tuesday, November 27th DEV372 – Infrastructure Is Code: with the AWS Cloud Development Kit 11:30AM | Venetian, Level 2, Titian 2202 Monday, November 26th DEV411 – Infrastructure as Code: AWS Best Practices (Chalk Talk) 7:00PM | Aria East, Level 1, Joshua 3 Repeats: Tuesday, November 27th 6:15PM @ Aria West, Level 3, Starvine 2 Wednesday, November 28th 1:45PM @ Mirage, Antigua B Thursday, November 29th 12:15PM @ Venetian, Level 2, Veronese 2402
  43. 43. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Ships with SDK (v1) AWS Open Source 3rd Party Open Source AWS Services Legend Ships with SDK (v2) Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs Toolkit for JetBrains AWS SDK for Java (v1) AWS SDK for Java (v2) Execution Environments AWS Elastic Beanstalk Amazon Elastic Map Reduce (EMR) Amazon EC2 Container Service (ECS) Amazon Elastic Compute (EC2) AWS Lambda Kinesis Consumer Library Kinesis Producer Library Streaming HTTP/2 Bi- Directional Streaming Cloud Development Kit (CDK)
  44. 44. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Ships with SDK (v1) AWS Open Source 3rd Party Open Source AWS Services Legend Ships with SDK (v2) Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs Toolkit for JetBrains AWS SDK for Java (v1) AWS SDK for Java (v2) Kinesis Consumer Library Kinesis Producer Library Streaming HTTP/2 Bi- Directional Streaming Cloud Development Kit (CDK) Execution Environments AWS Elastic Beanstalk Amazon Elastic Map Reduce (EMR) Amazon EC2 Container Service (ECS) Amazon Elastic Compute (EC2) AWS Lambda Amazon Corretto
  45. 45. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  46. 46. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Corretto Amazon supported OpenJDK implementation Multiplatform Free LTS support Corretto 8 until 2023 Corretto 11 until (at least) 2024 Currently in preview, expected to GA Q1 2019 Open source - https://github.com/corretto More info - https://aws.amazon.com/corretto
  47. 47. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  48. 48. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Ships with SDK (v1) AWS Open Source 3rd Party Open Source AWS Services Legend Ships with SDK (v2) Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs Toolkit for JetBrains AWS SDK for Java (v1) AWS SDK for Java (v2) Kinesis Consumer Library Kinesis Producer Library Streaming HTTP/2 Bi- Directional Streaming Cloud Development Kit (CDK) Execution Environments AWS Elastic Beanstalk Amazon Elastic Map Reduce (EMR) Amazon EC2 Container Service (ECS) Amazon Elastic Compute (EC2) AWS Lambda Amazon Corretto Summary Serverless deployment with IntelliJ New APIs with SDK v2 Faster SDK start-up in Lambda Full duplex streaming Infrastructure as code Amazon supported OpenJDK
  49. 49. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Leadership Session Thursday, November 29 Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate Innovation (SRV325) 12:15 – 1:15 PM | Venetian Theatre (Level 2)
  50. 50. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Kyle Thomson @thomskyl Sam Fink @finkinatorasu
  51. 51. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

×