Skip to content

Commit 9218c9c

Browse files
authored
Remove SDK dependencies from events library (#127)
* Bump to 3.0.0 * Update Docs and Release Notes
1 parent 9882774 commit 9218c9c

File tree

18 files changed

+3948
-143
lines changed

18 files changed

+3948
-143
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ___
3535
<dependency>
3636
<groupId>com.amazonaws</groupId>
3737
<artifactId>aws-lambda-java-events</artifactId>
38-
<version>2.2.8</version>
38+
<version>3.0.0</version>
3939
</dependency>
4040
<dependency>
4141
<groupId>com.amazonaws</groupId>
@@ -58,7 +58,7 @@ ___
5858

5959
```groovy
6060
'com.amazonaws:aws-lambda-java-core:1.2.1'
61-
'com.amazonaws:aws-lambda-java-events:2.2.8'
61+
'com.amazonaws:aws-lambda-java-events:3.0.0'
6262
'com.amazonaws:aws-lambda-java-events-sdk-transformer:1.0.0'
6363
'com.amazonaws:aws-lambda-java-log4j:1.0.1'
6464
'com.amazonaws:aws-lambda-java-log4j2:1.2.0'
@@ -68,7 +68,7 @@ ___
6868

6969
```clojure
7070
[com.amazonaws/aws-lambda-java-core "1.2.1"]
71-
[com.amazonaws/aws-lambda-java-events "2.2.8"]
71+
[com.amazonaws/aws-lambda-java-events "3.0.0"]
7272
[com.amazonaws/aws-lambda-java-events-sdk-transformer "1.0.0"]
7373
[com.amazonaws/aws-lambda-java-log4j "1.0.1"]
7474
[com.amazonaws/aws-lambda-java-log4j2 "1.2.0"]
@@ -78,7 +78,7 @@ ___
7878

7979
```scala
8080
"com.amazonaws" % "aws-lambda-java-core" % "1.2.1"
81-
"com.amazonaws" % "aws-lambda-java-events" % "2.2.8"
81+
"com.amazonaws" % "aws-lambda-java-events" % "3.0.0"
8282
"com.amazonaws" % "aws-lambda-java-events-sdk-transformer" % "1.0.0"
8383
"com.amazonaws" % "aws-lambda-java-log4j" % "1.0.1"
8484
"com.amazonaws" % "aws-lambda-java-log4j2" % "1.2.0"

aws-lambda-java-events/README.md

+43-105
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,36 @@
1-
# AWS Lambda Java Events v2.0
1+
# AWS Lambda Java Events v3.0
22

3-
### New Event Models Supported
4-
* APIGatewayProxyRequestEvent
5-
* APIGatewayProxyResponseEvent
6-
* APIGatewayV2ProxyRequestEvent
7-
* APIGatewayV2ProxyResponseEvent
8-
* CloudFrontEvent
9-
* CloudWatchLogsEvent
10-
* CodeCommitEvent
11-
* IoTButtonEvent
12-
* KinesisFirehoseEvent
13-
* LexEvent
14-
* ScheduledEvent
3+
### Event Models Supported
4+
* `APIGatewayProxyRequestEvent`
5+
* `APIGatewayProxyResponseEvent`
6+
* `APIGatewayV2ProxyRequestEvent`
7+
* `APIGatewayV2ProxyResponseEvent`
8+
* `CloudFrontEvent`
9+
* `CloudWatchLogsEvent`
10+
* `CodeCommitEvent`
11+
* `CognitoEvent`
12+
* `ConfigEvent`
13+
* `DynamodbEvent`
14+
* `IoTButtonEvent`
15+
* `KinesisAnalyticsFirehoseInputPreprocessingEvent`
16+
* `KinesisAnalyticsInputPreprocessingResponse`
17+
* `KinesisAnalyticsOutputDeliveryEvent`
18+
* `KinesisAnalyticsOutputDeliveryResponse`
19+
* `KinesisAnalyticsStreamsInputPreprocessingEvent`
20+
* `KinesisEvent`
21+
* `KinesisFirehoseEvent`
22+
* `LexEvent`
23+
* `S3Event`
24+
* `ScheduledEvent`
25+
* `SNSEvent`
26+
* `SQSEvent`
1527

16-
### New package inclusion model
17-
The old package inclusion model required users to pull unused dependencies into
18-
their package. We have removed this inclusion so that users' jars will be
19-
smaller, which will results in reduced latency times. Customers using older
20-
versions do not need to make any changes to their existing code.
28+
*As of version `3.0.0`, users are no longer required to pull in SDK dependencies in order to use this library.*
2129

22-
The following event models do not require any SDK dependencies
23-
* APIGatewayProxyRequestEvent
24-
* APIGatewayProxyResponseEvent
25-
* APIGatewayV2ProxyRequestEvent
26-
* APIGatewayV2ProxyResponseEvent
27-
* CloudFrontEvent
28-
* CloudWatchLogsEvent
29-
* CodeCommitEvent
30-
* CognitoEvent
31-
* ConfigEvent
32-
* IoTButtonEvent
33-
* KinesisFirehoseEvent
34-
* LexEvent
35-
* ScheduledEvent
36-
* SNSEvent
3730

38-
so the dependencies section in the pom.xml file would like this
31+
### Getting Started
32+
33+
[Maven](https://maven.apache.org)
3934

4035
```xml
4136
<dependencies>
@@ -48,86 +43,29 @@ so the dependencies section in the pom.xml file would like this
4843
<dependency>
4944
<groupId>com.amazonaws</groupId>
5045
<artifactId>aws-lambda-java-events</artifactId>
51-
<version>2.2.9</version>
46+
<version>3.0.0</version>
5247
</dependency>
5348
...
5449
</dependencies>
5550
```
5651

57-
#### S3 Event
58-
59-
For the S3 event the pom would look like this:
52+
[Gradle](https://gradle.org)
6053

61-
```xml
62-
<dependencies>
63-
...
64-
<dependency>
65-
<groupId>com.amazonaws</groupId>
66-
<artifactId>aws-lambda-java-core</artifactId>
67-
<version>1.2.1</version>
68-
</dependency>
69-
<dependency>
70-
<groupId>com.amazonaws</groupId>
71-
<artifactId>aws-lambda-java-events</artifactId>
72-
<version>2.2.9</version>
73-
</dependency>
74-
<dependency>
75-
<groupId>com.amazonaws</groupId>
76-
<artifactId>aws-java-sdk-s3</artifactId>
77-
<version>1.11.163</version>
78-
</dependency>
79-
...
80-
</dependencies>
54+
```groovy
55+
'com.amazonaws:aws-lambda-java-core:1.2.1'
56+
'com.amazonaws:aws-lambda-java-events:3.0.0'
8157
```
8258

83-
#### Kinesis Event
84-
85-
For the Kinesis event
59+
[Leiningen](http://leiningen.org) and [Boot](http://boot-clj.com)
8660

87-
```xml
88-
<dependencies>
89-
....
90-
<dependency>
91-
<groupId>com.amazonaws</groupId>
92-
<artifactId>aws-lambda-java-core</artifactId>
93-
<version>1.2.1</version>
94-
</dependency>
95-
<dependency>
96-
<groupId>com.amazonaws</groupId>
97-
<artifactId>aws-lambda-java-events</artifactId>
98-
<version>2.2.9</version>
99-
</dependency>
100-
<dependency>
101-
<groupId>com.amazonaws</groupId>
102-
<artifactId>aws-java-sdk-kinesis</artifactId>
103-
<version>1.11.163</version>
104-
</dependency>
105-
...
106-
</dependencies>
61+
```clojure
62+
[com.amazonaws/aws-lambda-java-core "1.2.1"]
63+
[com.amazonaws/aws-lambda-java-events "3.0.0"]
10764
```
10865

109-
#### Dynamodb Event
110-
111-
For the Dynamodb event
66+
[sbt](http://www.scala-sbt.org)
11267

113-
```xml
114-
<dependencies>
115-
...
116-
<dependency>
117-
<groupId>com.amazonaws</groupId>
118-
<artifactId>aws-lambda-java-core</artifactId>
119-
<version>1.2.1</version>
120-
</dependency>
121-
<dependency>
122-
<groupId>com.amazonaws</groupId>
123-
<artifactId>aws-lambda-java-events</artifactId>
124-
<version>2.2.9</version>
125-
</dependency>
126-
<dependency>
127-
<groupId>com.amazonaws</groupId>
128-
<artifactId>aws-java-sdk-dynamodb</artifactId>
129-
<version>1.11.163</version>
130-
</dependency>
131-
...
132-
</dependencies>
133-
```
68+
```scala
69+
"com.amazonaws" % "aws-lambda-java-core" % "1.2.1"
70+
"com.amazonaws" % "aws-lambda-java-events" % "3.0.0"
71+
```

aws-lambda-java-events/RELEASE.CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
### May 18, 2020
2+
`3.0.0`:
3+
- Removed AWS SDK v1 dependencies ([#74](https://github.com/aws/aws-lambda-java-libs/issues/74))
4+
- Copied relevant S3, Kinesis and DynamoDB model classes under namespace `com.amazonaws.services.lambda.runtime.events.models`
5+
- S3:
6+
- `S3EventNotification`
7+
- Kinesis:
8+
- `EncryptionType`
9+
- `Record`
10+
- DynamoDB:
11+
- `AttributeValue`
12+
- `Identity`
13+
- `OperationType`
14+
- `Record`
15+
- `StreamRecord`
16+
- `StreamViewType`
17+
118
### May 13, 2020
219
`2.2.9`:
320
- Added field `operationName` to `APIGatewayProxyRequestEvent` ([#126](https://github.com/aws/aws-lambda-java-libs/pull/126))

aws-lambda-java-events/pom.xml

+6-17
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.amazonaws</groupId>
77
<artifactId>aws-lambda-java-events</artifactId>
8-
<version>2.2.9</version>
8+
<version>3.0.0</version>
99
<packaging>jar</packaging>
1010

1111
<name>AWS Lambda Java Events Library</name>
@@ -49,23 +49,12 @@
4949
<artifactId>joda-time</artifactId>
5050
<version>2.6</version>
5151
</dependency>
52+
5253
<dependency>
53-
<groupId>com.amazonaws</groupId>
54-
<artifactId>aws-java-sdk-s3</artifactId>
55-
<version>1.11.163</version>
56-
<scope>provided</scope>
57-
</dependency>
58-
<dependency>
59-
<groupId>com.amazonaws</groupId>
60-
<artifactId>aws-java-sdk-kinesis</artifactId>
61-
<version>1.11.163</version>
62-
<scope>provided</scope>
63-
</dependency>
64-
<dependency>
65-
<groupId>com.amazonaws</groupId>
66-
<artifactId>aws-java-sdk-dynamodb</artifactId>
67-
<version>1.11.163</version>
68-
<scope>provided</scope>
54+
<groupId>org.junit.jupiter</groupId>
55+
<artifactId>junit-jupiter-engine</artifactId>
56+
<version>5.5.2</version>
57+
<scope>test</scope>
6958
</dependency>
7059
</dependencies>
7160

aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/DynamodbEvent.java

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
/* Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
2-
1+
/*
2+
* Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5+
* the License. A copy of the License is located at
6+
*
7+
* http://aws.amazon.com/apache2.0
8+
*
9+
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11+
* and limitations under the License.
12+
*/
313
package com.amazonaws.services.lambda.runtime.events;
414

5-
import com.amazonaws.services.dynamodbv2.model.Record;
6-
715
import java.io.Serializable;
816
import java.util.List;
917

@@ -19,7 +27,7 @@ public class DynamodbEvent implements Serializable, Cloneable {
1927
/**
2028
* The unit of data of an Amazon DynamoDB event
2129
*/
22-
public static class DynamodbStreamRecord extends Record {
30+
public static class DynamodbStreamRecord extends com.amazonaws.services.lambda.runtime.events.models.dynamodb.Record {
2331

2432
private static final long serialVersionUID = 3638381544604354963L;
2533

@@ -52,7 +60,7 @@ public void setEventSourceARN(String eventSourceARN) {
5260
*
5361
* @return A string representation of this object.
5462
*
55-
* @see java.lang.Object#toString()
63+
* @see Object#toString()
5664
*/
5765
@Override
5866
public String toString() {

aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/KinesisEvent.java

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
/* Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
2-
1+
/*
2+
* Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5+
* the License. A copy of the License is located at
6+
*
7+
* http://aws.amazon.com/apache2.0
8+
*
9+
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11+
* and limitations under the License.
12+
*/
313
package com.amazonaws.services.lambda.runtime.events;
14+
415
import java.io.Serializable;
516
import java.util.List;
617

@@ -16,7 +27,7 @@ public class KinesisEvent implements Serializable, Cloneable {
1627
/**
1728
* The unit of data of an Amazon Kinesis stream
1829
*/
19-
public static class Record extends com.amazonaws.services.kinesis.model.Record {
30+
public static class Record extends com.amazonaws.services.lambda.runtime.events.models.kinesis.Record {
2031

2132
private static final long serialVersionUID = 7856672931457425976L;
2233

@@ -49,7 +60,7 @@ public void setKinesisSchemaVersion(String kinesisSchemaVersion) {
4960
*
5061
* @return A string representation of this object.
5162
*
52-
* @see java.lang.Object#toString()
63+
* @see Object#toString()
5364
*/
5465
@Override
5566
public String toString() {
@@ -109,7 +120,7 @@ public boolean equals(Object obj) {
109120
}
110121

111122
/* (non-Javadoc)
112-
* @see com.amazonaws.services.kinesis.model.Record#hashCode()
123+
* @see com.amazonaws.services.lambda.runtime.events.models.kinesis.Record#hashCode()
113124
*/
114125
@Override
115126
public int hashCode() {
@@ -288,7 +299,7 @@ public void setAwsRegion(String awsRegion) {
288299
*
289300
* @return A string representation of this object.
290301
*
291-
* @see java.lang.Object#toString()
302+
* @see Object#toString()
292303
*/
293304
@Override
294305
public String toString() {
@@ -413,7 +424,7 @@ public void setRecords(List<KinesisEventRecord> records) {
413424
*
414425
* @return A string representation of this object.
415426
*
416-
* @see java.lang.Object#toString()
427+
* @see Object#toString()
417428
*/
418429
@Override
419430
public String toString() {

0 commit comments

Comments
 (0)