Documentation

Complete guide to using sls.tf for Serverless Framework to Terraform conversion

Quick Start Example

Convert an existing serverless.yml to Terraform in two steps. See the full Quick Start guide for outputs and next steps.

1. Reference sls.tf in your Terraform

Point the module at your existing serverless.yml. No cloning or submodules — Terraform downloads sls.tf on init:

main.tf

provider "aws" {
  region = "us-east-1"
}

module "serverless" {
  source = "git::https://github.com/sls-tf/sls.tf.git?ref=v0.3.16"

  config_path = "${path.module}/serverless.yml"
}

2. Deploy with Terraform

sls.tf infers the Lambda functions, IAM roles, API Gateway, and permissions from your serverless.yml — deploy them with the standard workflow:

terraform init
terraform plan
terraform apply

Using AWS SAM? Point config_path at your template.yaml and add config_format = "sam" — everything else is the same. See the SAM template example.