This Maven plugin provides a goal to generate a bootstrap
file used for AWS Lambda custom runtimes.
By default, the goal is bound to the prepare-package
phase.
<build>
<plugins>
...
<plugin>
<groupId>me.julb</groupId>
<artifactId>aws-lambda-bootstrap-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-bootstrap-file</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<runtimeFileName></runtimeFileName><!-- defaults to ${project.artifactId} -->
<runtimeOptions></runtimeOptions><!-- optional -->
<outputFile></outputFile><!-- defaults to ${project.build.directory}/aws-lambda/bootstrap -->
</configuration>
</execution>
</executions>
</plugin>
...
</plugins>
</build>
The configuration above generates target/aws-lambda/bootstrap
with 0755
posix permissions and the following content:
#!/bin/sh
cd $LAMBDA_TASK_ROOT
./#runtimeFileName# #runtimeOptions#
The file is then ready to be packaged with the runtime script in a zip using the Maven Assembly plugin.
This project is totally open source and contributors are welcome.