• 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 InstancesAlertsVersion 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 BucketStatePython support
OverviewRuntimeGatewayMemoryBrowserCode InterpreterDev Mode
API Gateway Proxy
OverviewGeneral ConfigurationAuthenticationAPI KeysData SourcesResolversPipeline FunctionsCachingDelta SyncCustom DomainWAFCLI Commands
Deploying SAM/CFN TemplatesWorkflow Tips
OverviewCreating PluginsCLI OutputCustom CommandsCustom VariablesExtending the Configuration schemaExtending and overriding configuration
OverviewDashboardAxiom
Overviewdeploydeploy functiondeploy listdevdiffinfoinvokeinvoke localloginlogin awslogin aws ssologsmetricspackageplugin installplugin uninstallprintprunereconcileremoverollbackrollback functionsupportusage
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. Plugins
  3. Extending And Overriding Configuration

Extending and overriding configuration

Plugins can extend and override the internal configuration.

To do so, plugins may use the serverless.extendConfiguration(...) method. This is only allowed at pre-init stage of serverless. The method also takes care of resolving all variables in the given value. But it does not validate you input nor the target. Improper usage can cause serverless to fail.

The serverless.extendConfiguration(configurationPathKeys, value) method takes two arguments.

ArgumentTypeDescription
configurationPathKeysstring[]Path of the configuration property to set; must not be empty
valuestring | object | arrayNew value of the configuration property in configurationPathKeys

If configuration in configurationPathKeys does exist the value will be overwritten. If configuration in configurationPathKeys does not exist the whole path will be created.

You can use it in plugin constructor, or if for some reason configuration extension is resolved asynchronously you may resort to asyncInit() method

class MyPlugin {
  constructor(serverless) {
    this.serverless = serverless

    const value = {
      myKey: 'myValue',
    }
    this.serverless.extendConfiguration(['custom', 'myPlugin'], value)
  }
}

module.exports = MyPlugin

If your plugin needs merging you need to take care of it yourself.

class MyPlugin {
  constructor(serverless) {
    this.serverless = serverless

    const currentConfig = this.serverless.configurationInput.custom.myPlugin
    const value = Object.assign(currentConfig, {
      myKey: 'myValue',
    })
    this.serverless.extendConfiguration(['custom', 'myPlugin'], value)
  }
}

module.exports = MyPlugin
Edit this page
Prev Extending the Configuration schemaNextOverview

Contents

  • Extending and overriding configuration

Related

GuidesPluginsExamplesSlack CommunitySupport