Serverless CloudFormation Sub Variables Plugin

JSON →
library 0.2.1 ·javascript
verified May 27, 2026

This plugin for the Serverless Framework enhances `serverless.yml` files by automatically converting a custom `#{Variable}` syntax into AWS CloudFormation `Fn::Sub` functions. It supports a wide range of CloudFormation variables, including template parameters, resource logical IDs, resource attributes, pseudo parameters (e.g., `AWS::Region`), literal variables, and key-value map `Fn::Sub` functions. The plugin operates during the `package` command, executing its transformations after Serverless variables (`${self:variable}`) are resolved but before the CloudFormation template is packaged for deployment. A key feature is its ability to automatically wrap strings with `Fn::Sub` unless `Fn::Sub` is already explicitly defined in the parent YAML node, providing flexibility for complex scenarios. The current stable version is 0.2.1, released in late 2023, reflecting a deliberate, slower release cadence focused on stability and specific bug fixes. Its primary differentiator is the transparent and generic conversion of `#{...}` syntax across the entire CloudFormation template portion of `serverless.yml`, simplifying complex CloudFormation variable usage without extensive manual `Fn::Sub` declarations.

total hits 20
actors 8 distinct systems
last hit 21h ago human
GPTBot
5
MetaBot
4
Script
2
ClaudeBot
1
Search engines
2
Humans
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇮🇳 India · IQ · 🇳🇴 Norway