Skip to content

Instantly share code, notes, and snippets.

@rjozefowicz
Last active January 31, 2021 10:02
Show Gist options
  • Save rjozefowicz/010d62f3751b288a6d54bb9558e8a2c4 to your computer and use it in GitHub Desktop.
Save rjozefowicz/010d62f3751b288a6d54bb9558e8a2c4 to your computer and use it in GitHub Desktop.
Spring Cloud Function AWS - StacjaIT - 31.01.2021
@rjozefowicz
Copy link
Author

private final static List<String> EXTENSIONS = List.of(".jpg", ".jpeg", ".gif", ".bmp", ".png");

@rjozefowicz
Copy link
Author

rjozefowicz commented Jan 31, 2021

SAM Template

  Function:
    Type: AWS::Serverless::Function
    Properties:
      Timeout: 300
      MemorySize: 1024
      Handler: dev.jozefowicz.companydisc.function.handler.ImageAnalysisHandler
      CodeUri: Function
      Runtime: java11
      Environment:
        Variables:
          MAIN_CLASS: dev.jozefowicz.companydisc.function.ImageAnalysisApplication
          FUNCTION_NAME: imageAnalysisConsumer

@rjozefowicz
Copy link
Author

public class UUIDGenerator implements RequestHandler<Void, String> {

    @Override
    public String handleRequest(Void unused, Context context) {
        return UUID.randomUUID().toString();
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment