A serverless UI + API to render PlantUML diagrams.
This can be used as a drop in replacement for scenarios where http://www.plantuml.com/plantuml is used as a rendering endpoint. You can avoid sending the diagram source to a server outside your control and use an encrypted HTTPS endpoint for the diagram traffic.
This doesn't support everything the official PlantUML server does but should be good for most intents and purposes (PNG, SVG and TXT rendering).
For example, to have Visual Studio Code PlantUML plugin render using your own serverless deployment, set the following properties in vscode for the plugin:
"plantuml.render": "PlantUMLServer",
"plantuml.server": "https://your-endpoint-here"
Use "plantuml.server": "https://plantuml.nitorio.us"
if you'd like to try before you deploy your own.
npm ci
mvn clean package
You can deploy with Serverless framework or AWS SAM.
This used to be available on the AWS Serverless Application Repository, but currently that's not possible because it doesn't appear to support lambda functions packaged as container images.
- Edit
serverless.yml
to replacecustom.domains.dev
andcustom.domains.prod
with your own domain names.- If you don't want a custom domain name, remove or comment out the
serverless-domain-manager
plugin from the plugins list and skip thesls create-cert
andsls create_domain
commands.
- If you don't want a custom domain name, remove or comment out the
- Run
sls create-cert
to create an ACM certificate for your domain as configured incustom.customCertificate
. - Run
sls create_domain
to create an API Gateway custom domain as configured incustom.customDomain
. - Run
sls deploy
.
The above steps deploy the default dev
stage. To deploy the prod
stage, add --stage prod
to each command.
- Run
sam-deploy.sh
The SAM deployment doesn't include custom domains currently.
- Set the region in the
serverless.yml
file, then deploy usingsls deploy
- Ensure gateway urls are the same and matches the ones used in region CF worker
- Ensure the gateway custom domain (plant-aws.diagrams.net) API mapping is correct. Currently, it points to
prod-plantuml-serverless
-prod
ineu-central-1
region - You can edit the domain manually also from (API Gateway -> Custom domain names) and set the new stack name (API Mapping)