Skip to content

Commit 2f83e55

Browse files
msailesraupachz
authored andcommitted
Add Application Load Balancer Target Events (aws#131)
* Classes to represent the request and response events for Application Load Balancer integration.
1 parent b36cf54 commit 2f83e55

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

aws-lambda-java-events/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* `APIGatewayProxyResponseEvent`
66
* `APIGatewayV2ProxyRequestEvent`
77
* `APIGatewayV2ProxyResponseEvent`
8+
* `ApplicationLoadBalancerRequestEvent`
9+
* `ApplicationLoadBalancerResponseEvent`
810
* `CloudFrontEvent`
911
* `CloudWatchLogsEvent`
1012
* `CodeCommitEvent`

aws-lambda-java-events/pom.xml

+6
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
<version>5.5.2</version>
5757
<scope>test</scope>
5858
</dependency>
59+
<dependency>
60+
<groupId>org.projectlombok</groupId>
61+
<artifactId>lombok</artifactId>
62+
<version>1.18.12</version>
63+
<scope>provided</scope>
64+
</dependency>
5965
</dependencies>
6066

6167
<profiles>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package com.amazonaws.services.lambda.runtime.events;
2+
3+
import lombok.Data;
4+
import lombok.NoArgsConstructor;
5+
6+
import java.io.Serializable;
7+
import java.util.List;
8+
import java.util.Map;
9+
10+
/**
11+
* Class to represent the request event from Application Load Balancer.
12+
*
13+
* @see <a href="https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html">Using AWS Lambda with an Application Load Balancer</a>
14+
*
15+
* @author msailes <[email protected]>
16+
*/
17+
18+
@NoArgsConstructor
19+
@Data
20+
public class ApplicationLoadBalancerRequestEvent implements Serializable, Cloneable {
21+
22+
@NoArgsConstructor
23+
@Data
24+
public static class Elb implements Serializable, Cloneable {
25+
26+
private String targetGroupArn;
27+
28+
}
29+
30+
@NoArgsConstructor
31+
@Data
32+
public static class RequestContext implements Serializable, Cloneable {
33+
34+
private Elb elb;
35+
36+
}
37+
38+
private RequestContext requestContext;
39+
private String httpMethod;
40+
private String path;
41+
private Map<String, String> queryStringParameters;
42+
private Map<String, String> headers;
43+
private Map<String, List<String>> multiValueHeaders;
44+
private String body;
45+
private boolean isBase64Encoded;
46+
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.amazonaws.services.lambda.runtime.events;
2+
3+
import lombok.Data;
4+
import lombok.NoArgsConstructor;
5+
6+
import java.io.Serializable;
7+
import java.util.List;
8+
import java.util.Map;
9+
10+
/**
11+
* Class to represent the response event to Application Load Balancer.
12+
*
13+
* @see <a href="https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html">Using AWS Lambda with an Application Load Balancer</a>
14+
*
15+
* @author msailes <[email protected]>
16+
*/
17+
18+
@NoArgsConstructor
19+
@Data
20+
public class ApplicationLoadBalancerResponseEvent implements Serializable, Cloneable {
21+
22+
private int statusCode;
23+
private String statusDescription;
24+
private boolean isBase64Encoded;
25+
private Map<String, String> headers;
26+
private Map<String, List<String>> multiValueHeaders;
27+
private String body;
28+
29+
}

0 commit comments

Comments
 (0)