UserData Powered By Handlebars
This construct enables the use of Handlebars templates as Userdata. Often times UserData scripts are long, complex, and require inserting other variables from your environment. This construct extends the base functionality of the default ec2.UserData class to include Handlebars.
Usage
import { HandlebarsUserData } from '@arhea/aws-userdata-handlebars';
import * as path from 'path';
const webUserData = HandlebarsUserData.forLinux();
webUserData.addTemplateFile(path.join(__dirname, 'userdata', 'webserver.handlebars'));
webUserData.addData('loadBalancerUrl', `http://${app.loadBalancerDnsName}`);
Useful commands
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit tests