Skip to main content
This feature is in public preview.
An instance template defines the configuration for an instance: which image to boot and an optional cloud-init script. Deployments use templates to create instances with a consistent configuration. Templates are immutable. To change a configuration, create a new template and update your deployment to reference it. See deployments for how a deployment picks up the change.

Create an instance template

Create a template with a name and an image. Public images require the full sfc:image:sfcompute:public:... name; SF Compute rejects the short trailing segment on its own.
A template captures one exact image build. SF Compute resolves the image name when you create the template and stores that build’s id, so later versions of the same name never reach an existing template. Pass an image id to name the build explicitly; templates take a name or an id, not the name@<version> pin form.

Cloud-init

Pass a startup script or cloud-config YAML file via --cloud-init. The template stores the file and applies it to every instance you create from it. Maximum size is 64 KB. Cloud-init data isn’t parameterized per instance: every instance created from the template receives the same bytes. For per-instance identity, use a deployment’s instance name template. For example, this startup script installs an SSH key.
startup.sh
Create a template that uses the script.

List templates

List the templates in your workspace.

Get template details

Get a template by name or ID.
Template IDs use the itmpl_ prefix. You can still pass older IDs with the legacy ntmpl_ prefix.

Delete a template

Delete a template by name or ID.
You can’t delete a template while a deployment or running instance uses it. Update or delete the deployment, or terminate the instance, first.

API reference

See the Instance Templates API for programmatic access.