Create custom templates
You can create custom STACKIT Functions templates, by following the structure of the Official templates.
In particular, a templates repository should contain a separate folder for each template, containing a stackit-functions.yaml file. Repository layout:
https://git-host.example/user/repository-name.git
|-- template-folder
| |-- stackit-functions.yaml
| |-- README.md
| `-- ... source code
`-- ... other templates
The stackit-functions.yaml should contain a function block, defining, at minimum, the name of the template, as well as the runtime and trigger parameters:
function:
name: ts-template
runtime: nodets
trigger: http
The runtime will be used by the STACKIT Function CLI to select the correct entrypoint, as described by the Generated code reference.
Installing custom templates
To install a custom templates repository, use the template install subcommand:
sfn template install --source https://git-host.example/user/repository-name.git
Then, the sfn function create will then be able to use your the custom templates for initializing new function projects.