Contenu connexe Similaire à Hands-on in the AWS Java Ecosystem (DEV325-R1) - AWS re:Invent 2018 (20) Plus de Amazon Web Services (20) Hands-on in the AWS Java Ecosystem (DEV325-R1) - AWS re:Invent 20182. © 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
3. © 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)
4. © 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
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
6. © 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
7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
8. © 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
9. © 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
10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
13. © 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
14. © 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!
15. © 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
16. © 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
17. © 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)
18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
19. © 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
20. © 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
21. © 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
22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
23. © 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
24. © 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
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)
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
26. © 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
27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
28. © 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!
29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Cloud
Development
Kit
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
34. © 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)
35. © 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
36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Simple CDK example
Stack
37. © 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());
38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Simple CDK example
39. © 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);
40. © 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" }
}
}
}
}
41. © 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" }
}
}
42. © 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
43. © 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
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)
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)
45. © 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
46. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
47. © 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
48. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
49. © 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
50. © 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)
51. Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Kyle Thomson
@thomskyl
Sam Fink
@finkinatorasu
52. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.