Compiling Fuseless in Cloud 9 for Coldfusion/CFML in AWS Lambda
In the previouse article on CFML I provided a very high level overview of CFML in Lambda. In this post I will show how easy it is to:
- Install a JDK on Cloud9
- Install gradle for java projects
- Compile Fuseless from source
- Deploy a CFML mini app to AWS Lamba
The video provided shows htat in 7 minutes I was able to from a completly fresh enviroment deploy a PoC CFML lambda app.
Every step exectued is listed below with some commentary.
# Install Coretto ( java 1.8 ) - https://aws.amazon.com/corretto this is the jdk required to compile Fuseless
sudo yum install -y https://corretto.aws/downloads/latest/amazon-corretto-8-x64-linux-jdk.rpm
# Download gradle and unzip it to /opt/gradle
wget https://services.gradle.org/distributions/gradle-6.5-bin.zip -P /tmp
sudo unzip -d /opt/gradle /tmp/gradle-6.5-bin.zip
# Set 2 EVN variables to add gradel to the path
export GRADLE_HOME=/opt/gradle/gradle-6.5
export PATH=${GRADLE_HOME}/bin:${PATH}
# Ensure the ENV variables persist in a new terminal session
cat >> ~/.bash_profile <<TXT
export GRADLE_HOME=${GRADLE_HOME}
export PATH=${GRADLE_HOME}/bin:${PATH}
TXT
Open a new terminal ( Java home wont be set after the corretto install untill you set it or opena new terminal ).
# Check is java is avaliable for use
java -version
# Check is gradle is avaliable for use
gradle -v
Clone and build Fuseless
git clone https://github.com/foundeo/fuseless.git
cd fuseless
# Run the test shell script, this will build the package, download lucee light and run some tests.
./test.sh
Look for the passing tests:
Deployment
# Deploy section, clone the fuseless-template repo, there is an open PR to include the out outputs of the API endpoint
# for now the repo is a fork of fuseless-template
cd ..
git clone https://github.com/kukielp/fuseless-template.git
cd fuseless-template
# This shell script will download the fuseless jar and lucee light plus
./init.sh
# This will package up/zip the cfml and jars required
gradle build
# Guideded process to deploy.
sam deploy --guided
Open the URL, be sure to append the template in this example it’s dump.cfm
Full video:
If you are not sure what CLoud 9 is it’s basical a Virtual machine with a web based IDE. I am runnign Amazon Linux. You can read more about it here: https://aws.amazon.com/cloud9/