forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#4777 from patriot1burke/aws-native
Native
- Loading branch information
Showing
69 changed files
with
2,657 additions
and
1,220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...ent/src/main/java/io/quarkus/amazon/lambda.http/deployment/AmazonLambdaHttpProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,53 @@ | ||
package io.quarkus.amazon.lambda.http.deployment; | ||
|
||
import org.jboss.logging.Logger; | ||
|
||
import io.quarkus.amazon.lambda.deployment.ProvidedAmazonLambdaHandlerBuildItem; | ||
import io.quarkus.amazon.lambda.http.LambdaHttpHandler; | ||
import io.quarkus.amazon.lambda.http.model.AlbContext; | ||
import io.quarkus.amazon.lambda.http.model.ApiGatewayAuthorizerContext; | ||
import io.quarkus.amazon.lambda.http.model.ApiGatewayRequestIdentity; | ||
import io.quarkus.amazon.lambda.http.model.AwsProxyRequest; | ||
import io.quarkus.amazon.lambda.http.model.AwsProxyRequestContext; | ||
import io.quarkus.amazon.lambda.http.model.AwsProxyResponse; | ||
import io.quarkus.amazon.lambda.http.model.CognitoAuthorizerClaims; | ||
import io.quarkus.amazon.lambda.http.model.ErrorModel; | ||
import io.quarkus.amazon.lambda.http.model.Headers; | ||
import io.quarkus.amazon.lambda.http.model.MultiValuedTreeMap; | ||
import io.quarkus.deployment.annotations.BuildProducer; | ||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.deployment.builditem.LaunchModeBuildItem; | ||
import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem; | ||
import io.quarkus.runtime.LaunchMode; | ||
import io.quarkus.vertx.http.deployment.RequireVirtualHttpBuildItem; | ||
|
||
public class AmazonLambdaHttpProcessor { | ||
private static final Logger log = Logger.getLogger(AmazonLambdaHttpProcessor.class); | ||
|
||
@BuildStep | ||
public RequireVirtualHttpBuildItem requestVirtualHttp(LaunchModeBuildItem launchMode) { | ||
return launchMode.getLaunchMode() == LaunchMode.NORMAL ? RequireVirtualHttpBuildItem.MARKER : null; | ||
} | ||
|
||
@BuildStep | ||
public ProvidedAmazonLambdaHandlerBuildItem setHandler() { | ||
return new ProvidedAmazonLambdaHandlerBuildItem(LambdaHttpHandler.class, "AWS Lambda HTTP"); | ||
} | ||
|
||
@BuildStep | ||
public void registerReflectionClasses(BuildProducer<ReflectiveClassBuildItem> reflectiveClassBuildItemBuildProducer) { | ||
reflectiveClassBuildItemBuildProducer | ||
.produce(new ReflectiveClassBuildItem(true, true, true, | ||
AlbContext.class, | ||
ApiGatewayAuthorizerContext.class, | ||
ApiGatewayRequestIdentity.class, | ||
AwsProxyRequest.class, | ||
AwsProxyRequestContext.class, | ||
AwsProxyResponse.class, | ||
CognitoAuthorizerClaims.class, | ||
ErrorModel.class, | ||
Headers.class, | ||
MultiValuedTreeMap.class)); | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
extensions/amazon-lambda-http/deployment/src/main/resources/sam.jvm.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Transform: AWS::Serverless-2016-10-31 | ||
Description: AWS Serverless Quarkus - ${descriptionName} | ||
Globals: | ||
Api: | ||
EndpointConfiguration: REGIONAL | ||
|
||
Resources: | ||
${resourceName}Function: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: ${handler} | ||
Runtime: java8 | ||
CodeUri: ${artifact} | ||
MemorySize: 512 | ||
Policies: AWSLambdaBasicExecutionRole | ||
Timeout: 15 | ||
Events: | ||
GetResource: | ||
Type: Api | ||
Properties: | ||
Path: /{proxy+} | ||
Method: any |
Oops, something went wrong.