Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

svdgraaf/serverless-parameters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless Parameters

This plugin adds the possibility to add CloudFormation parameters to your Serverless applications. This is convenient if you want to just generate a CloudFormation template, and use it as a subtemplate for some other stack, or when you are deploying somethign manually or via a cloudformation deploy button.

Installation

Install the plugin through npm: npm install serverless-parameters. Add it your Serverless plugin list:

plugins:
  - serverless-parameters

Usage

After installation, you can now add parameters to the custom key:

custom:
  parameters:
    EnableFeatureX:
      Type: String
      AllowedValues: yes,no
      Default: yes
      Description: Enable feature X
    VPCId:
      Type: AWS::EC2::VPC::Id
      Description: Select the VPC you want to use
    SomeEnvVarPrefilled:
      Type: String
      Default: ${env:MY_ENV_VAR}
      Description: A default parameter, filled with a value from your env when deployed with `sls deploy`

All the properties are added to the template as-is, so you can use any of the CloudFormation parameter properties.

You can then add Ref's on the places where you want to use them, eg in your environment settings:

provider:
  name: aws
  environment:
    FEATURE_X:
      Ref: EnableFeatureX
    some_env_var:
      Ref: SomeEnvVarPrefilled

Todo

Add option for adding AWS::CloudFormation::Interface descriptions and such. PR's are welcome!

About

This plugin will add parameters to your cloudformation template, making it easier to deploy a template manually, or use it as a subtemplate.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •