Socket
Book a DemoInstallSign in
Socket

serverless-plugin-time-substitution

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-plugin-time-substitution

Serverless plugin to substitute time in compiled cloudformation template

1.0.6
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

serverless-plugin-time-substitution

Serverless plugin to substitute time in compiled cloudformation template

Add a time placeholder to your CloudFormation template and the plugin will replace this with the time.

This is especially useful for Api Gateway deployments that are not automatically generated by the serverless framework.

...
Resources:
    ApiGatewayDeployment_##time##:
        Type: AWS::ApiGateway::Deployment
        Properties:
...

You just need to add some placeholders in your CloudFormation template:

  • ##time##: Is substituted by the time in YYYYMMDDhhmmss format (Example: 20190430131815)
  • ##time_long##: Is substituted by the time in a longer format (Example: Tue Apr 30 2019 13:18:15 GMT-0600 (GMT-06:00))

The plugin is run after the serverless package command is executed.

The placeholders can be configured using the custom section in the serverless.yml file:

...
custom:
    timeSubstitution:
        patternShort: &&time&&
        patternLong: &&long_time&&
...

Getting Started

  • Install plugin from npm:
npm install --save-dev serverless-plugin-time-substitution
  • Add to the plugins section of your serverless.yml:
plugins:
  - serverless-plugin-time-substitution
  • Include placeholders in your CloudFormation templates.

More Info

Heavily influenced by serverless-cloudformation-sub-variables

Keywords

serverless

FAQs

Package last updated on 05 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.