• Documentation
  • Pricing
© 2026 Serverless, Inc. All rights reserved.

Framework

  • Overview
  • Documentation
  • Plugins360
  • Pricing

Learn

  • Blog
  • GuidesUpdated
  • Examples240
  • Courses

Resources

  • Support
  • Security
  • Trust Center
  • Status

Community

  • Slack
  • GitHub47k
  • Forum
  • Meetups

Company

  • About
  • Careers
  • Contact
  • Partners

Legal

  • Terms of Service
  • Privacy Policy
  • Trademark
  • DMCA
Serverless Framework Logo

Serverless Framework

Intro
SetupUpgrading To V4ConceptsTutorialAWS CredentialsLicense Keys
DeployingPackagingBuildingTestingServicesFunctions
OverviewHTTP (API Gateway v2)REST (API Gateway v1)ActiveMQApplication Load BalancerAlexa SkillAlexa Smart HomeCloudWatch EventCloudWatch LogCloudFrontCognito User PoolEventBridge EventIoTIoT Fleet ProvisioningKafkaKinesis & DynamoDBMSKRabbitMQS3ScheduleSNSSQSWebsocket
LayersManaged InstancesSandboxes (Lambda MicroVMs)MCP ServersAlertsVersion PruningDomainsIAM Function PermissionsParameters
OverviewSelf-reference serverless.ymlServerless CoreEnvironment VariablesCLI OptionsExternal YAML/JSON FilesJavascript propertiesGitDoppler
OverviewS3 ObjectsSSM Parameter Store & Secrets ManagerCloudFormation Stack Outputs
OverviewVaultTerraform State Output
ResourcesComposing ServicesDeployment BucketStateAgent SkillsPython support
OverviewRuntimeGatewayMemoryBrowserCode InterpreterDev Mode
API Gateway Proxy
OverviewGeneral ConfigurationAuthenticationAPI KeysData SourcesResolversPipeline FunctionsSubstitutionsCachingDelta SyncCustom DomainWAFCLI Commands
Deploying SAM/CFN TemplatesWorkflow Tips
OverviewCreating PluginsCLI OutputCustom CommandsCustom VariablesExtending the Configuration schemaExtending and overriding configuration
OverviewDashboardAxiom
Overviewagent docsagent inspectagent setupagent skills installagent skills list / readdeploydeploy functiondeploy listdevdiffinfoinvokeinvoke localloginlogin awslogin aws ssologsmetricspackageplugin installplugin uninstallprintprunereconcileremoverollbackrollback functionusage
Overview
OverviewMetricsTracesTroubleshoot
OverviewNode.jsPython
OutputsProviders
OverviewBranch DeploymentsPreview DeploymentsCustom ScriptsTestingPrivate PackagesNotificationsMono ReposDeploy in your own CI/CDBest PracticesTroubleshootingFAQ
OverviewSetupToolsAWS Integration
Serverless.yml Reference
Examples and TutorialsConfiguration Validation
  1. Usage
  2. App Sync
  3. Substitutions

⚠️ Substitutions are deprecated. Use environment variables instead.

Substitutions

Substitutions replace variables in your VTL mapping templates or JS resolvers with dynamic values.

They are useful for injecting resource names or ARNs from your infrastructure, such as a DynamoDB table name, or values like the stage or region.

Usage

Substitutions are defined as key-value pairs under appSync.substitutions, appSync.resolvers.[resolverName].substitutions or appSync.pipelineFunctions.[functionName].substitutions.

Global substitutions are available to all mapping templates. Resolver and pipeline function substitutions are only available where they are defined, and take precedence over global substitutions with the same name.

In VTL mapping templates, reference a substitution as ${name}. In JS resolvers, reference it as a string wrapped in #, such as '#name#'. At deployment time, each reference is replaced with its value.

appSync:
  name: my-api
  substitutions: # global substitutions
    postsTable: !Ref Posts
    region: !Ref AWS::Region
    foo: bar

  resolvers:
    Query.user:
      dataSource: my-table
      substitutions: # resolver substitutions
        someVariable: someValue

VTL mapping template:

{
    "version" : "2018-05-29",
    "operation" : "BatchPutItem",
    "tables" : {
        "${postsTable}": [...]
    }
}

JS resolver:

const tableName = '#postsTable#'
return {
  operation: 'BatchGetItem',
  tables: {
    [tableName]: { keys },
  },
}
Edit this page
Prev Pipeline FunctionsNextCaching

Contents

  • Substitutions
  • Usage

Related

GuidesPluginsExamplesSlack CommunitySupport