Serverless & SAM
→ Terraform
Drop your SAM template.yaml or serverless.yml. Get production Terraform. No rewrites.
service: my-api provider: name: aws runtime: nodejs20.x stage: prod functions: hello: handler: src/hello.handler events: - httpApi: path: /hello method: GET
module "api" { source = "git::https://github.com/ sls-tf/sls.tf.git?ref=v0.3.16" config_path = "./serverless.yml" aws_region = "us-east-1" } # Lambda, API GW, IAM roles — # all provisioned automatically.
First-class support for AWS SAM template.yaml — Globals, Parameters, and CloudFormation intrinsics included. Serverless Framework serverless.yml works the same way. Point at either; no migration step.
Resolves ${self:custom.foo}, environment-specific overrides, and nested references at plan time.
Evaluates TypeScript serverless.ts exports, including async factory functions that return the config object.
Provisions HTTP API v2 and REST API v1 resources, routes, integrations, and custom authorizers.
Creates tables declared in resources.Resources with keys, billing mode, TTL, and stream settings preserved.
Synthesises least-privilege execution roles per function, merging provider-level and function-level statements.
Reference the module. Point at your config. Done.
module "service" { source = "git::https://github.com/sls-tf/sls.tf.git?ref=v0.3.16" config_path = "./template.yaml" # serverless.yml, template.yaml, or serverless.ts config_format = "sam" # yaml | sam | typescript aws_region = "us-east-1" }
terraform init?ref=v0.3.16Start converting in 5 minutes
Read the docs →