go-serverless-hello-world/

directory
v0.0.0-...-d2705f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2020 License: MIT

README

Golang serverless example

A demo stack with two lambdas (created from serverless.com template).

See usage of custom resource ApiKeyValue in serverless.yml file:

  DevApiKeyValue:
    Type: Custom::ApiKeyValue
    Properties:
      ServiceToken: ${cf:custom-resources-dev.ServiceToken}
      ApiKeyId: !Ref DevApiKey
      SsmParamPath: /api/keys/${self:provider.stage}

Above resource reads the value of DevApiKey and store it in /api/keys/dev SSM secure parameter.

Endpoints

First endpoint /dev/hello is public, second /dev/world is private. To invoke it pass x-api-key header.

Building and deployment

Install serverless and make (brew install make on MacOS) and then run:

make clean build deploy

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL