LCA as AWS Lambda: Development
Learn how to develop custom Life Cycle Actions (LCA) as AWS Lambda functions using Reltio's life-cycle-framework-lambda library and sample project.
LCA Development
- A working knowledge of the LCA Framework
- Sample Life Cycle Actions Lambda projectto use as a starting point.
- A JAR file that includes all required dependencies.Attention: The repository containing sample code for building LCAs is temporarily unavailable. If you plan to use the sample code, create a support ticket to request it.
Dependencies
To get the Life Cycle Framework for the AWS Lambda library, add the following Maven dependency:
<dependency>
<groupId>com.reltio</groupId>
<artifactId>life-cycle-framework-lambda</artifactId>
</dependency>
Download the dependency from the Reltio public repository. For more information about accessing the LCA framework from the Reltio public repository, see LCA Framework. You can add the following code to the repository and the settings.xml file in the Maven folder or the pom.xml file:
<repository>
<id>reltio-libs-public</id>
<name>Reltio public repository</name>
<url>https://repo-dev.reltio.com/content/repositories/public/</url>
</repository>
Usage
Instead of extending the com.reltio.lifecycle.framework.LifeCycleActionBase class (as usual for a Life Cycle Action Handler), you must extend com.reltio.lifecycle.lambda.LifeCycleActionHandler. This class extends com.reltio.lifecycle.framework.LifeCycleActionBase and adds functionality specific to the execution of the AWS Lambda Function.
Packaging
A Life Cycle Action Handler for deployment as an AWS Lambda Function must be packaged with all the dependencies. The handler is invoked as a standalone application and not inside the Life Cycle Action Service infrastructure. To create a JAR with dependencies in a Maven project, you can add the following plugin to the pom.xml:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>