Skip to the content.

EC2

These are the constructs and classes of this library that deal with EC2.

UserDataBuilder

The UserDataBuilder class has static methods that create a builder object for either Linux or Windows.

const builder = UserDataBuilder.forLinux({ shebang: "#!/bin/bash" });
builder.addCommands("curl https://example.com/");
builder.insertCommands(-5000, "apt update", "apt safe-upgrade");
builder.insertCommands(216, "service php8.1-fpm start");
builder.insertCommands(234, "service nginx start");
const userData: UserData = builder.build();

Use Cases