Pronounced "lambda-wiki", but spelled with a 'y' because it was easier that typing out "lambda", and much easier than figuring out the Unicode every time.
This is a simple Markdown wiki, in Java, Jersey, AWS Lambda, and aws-serverless-java. It is designed to demonstrate fully automated build and deploy to AWS Lambda, as well as simple monitoring and metrics (devops).
Starting with https://github.com/awslabs/aws-serverless-java-container/tree/master/samples/jersey/pet-store as a seed project.
Make sure the following are installed:
If you have homebrew installed, use the following
brew update
brew cask install java
brew install maven
brew install awscli
Standard Maven build:
mvn clean packge
To run an instance locally:
mvn exec:java
This will wrap the Jersey instance in a Grizzly server and run at:
A simple deploy script exists to deploy the constructed JAR. Edit the deploy script to confirm:
- deployBucket - name of S3 bucket to use for holding deployable JARs
Then run:
./deploy.sh
This will:
- create an S3 bucket for deployments
- package and upload the versioned package
- deploy the version
- get the deployed URL
- test the correct version was deplyed
- Add simple MD file, make sure it gets served.
- Add simple SPA editor, host resources locally.
- Add Cognito integrated.
- Setup Swagger and API frontend
- Get POST/UPDATE working.
- Add cloud-based doc store.
- Clean up and release.
- Add fully automated deploy scripts
- Add project versioning
- Add log-query script
- Add status script / CW dash
- Auto-generate: (fill std template)
- Handler: from annotation on method
- Runtime: from mvn
- CodeUri: from mvn
- API Value: from @Path
- How will revision history be stored?
- How will AUTH be handled?
- How will authorization work? Ownership?
- What MD front-end? Pick editor with display only?
- DynamoDB: http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/examples-dynamodb.html
- S3: http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/examples-s3.html
- SimpleMDE: https://simplemde.com/
- StackEdit: https://github.com/benweet/stackedit
- Editor.md: https://pandao.github.io/editor.md/en.html DIAGRAM, 2-pane
- Trumpbowyg: http://alex-d.github.io/Trumbowyg/
- MarkdownPlus: https://github.com/tylingsoft/markdown-plus
- Bootstrap Markdown: http://www.codingdrama.com/bootstrap-markdown/
https://github.com/bramp/js-sequence-diagrams
- Which supports interaction diagrams?
Others:
Note: It would be great to use the same lib for both edit and display.
See also: http://www.developersfeed.com/awesome-javascript-wysiwyg-markdown-editors/
A basic pet store written with the Jersey framework. The LambdaHandler
object is the main entry point for Lambda.
The application can be deployed in an AWS account using the Serverless Application Model. The sam.yaml
file in the root folder contains the application definition
To build and install the sample application you will need Maven and the AWS CLI installed on your computer.
In a shell, navigate to the sample's folder and use maven to build a deployable jar.
$ mvn package
This command should generate a serverless-jersey-example-1.0-SNAPSHOT.jar
in the target
folder. Now that we have generated the jar file, we can use the AWS CLI to package the template for deployment.
You will need an S3 bucket to store the artifacts for deployment. Once you have created the S3 bucket, run the following command from the sample's folder:
$ aws cloudformation package --template-file sam.yaml --output-template-file output-sam.yaml --s3-bucket <YOUR S3 BUCKET NAME>
Uploading to xxxxxxxxxxxxxxxxxxxxxxxxxx 6464692 / 6464692.0 (100.00%)
Successfully packaged artifacts and wrote output template to file output-sam.yaml.
Execute the following command to deploy the packaged template
aws cloudformation deploy --template-file /your/path/output-sam.yaml --stack-name <YOUR STACK NAME>
As the command output suggests, you can now use the cli to deploy the application. Choose a stack name and run the aws cloudformation deploy
command from the output of the package command.
$ aws cloudformation deploy --template-file output-sam.yaml --stack-name ServerlessJerseySample --capabilities CAPABILITY_IAM
Once the application is deployed, you can describe the stack to show the API endpoint that was created. The endpoint should be the JerseyPetStoreApi
key of the Outputs
property:
$ aws cloudformation describe-stacks --stack-name ServerlessJerseySample
{
"Stacks": [
{
"StackId": "arn:aws:cloudformation:us-west-2:xxxxxxxx:stack/JerseySample/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
"Description": "Example Pet Store API written in jersey with the aws-serverless-java-container library",
"Tags": [],
"Outputs": [
{
"Description": "URL for application",
"OutputKey": "JerseyPetStoreApi",
"OutputValue": "https://xxxxxxx.execute-api.us-west-2.amazonaws.com/Prod/pets"
}
],
"CreationTime": "2016-12-13T22:59:31.552Z",
"Capabilities": [
"CAPABILITY_IAM"
],
"StackName": "JerseySample",
"NotificationARNs": [],
"StackStatus": "UPDATE_COMPLETE"
}
]
}
Copy the OutputValue
into a browser to test a first request.