Skip to content

Instantly share code, notes, and snippets.

@mattsan
Created July 24, 2019 08:18
Show Gist options
  • Save mattsan/b414d2313e284915446d659f3ab9d78a to your computer and use it in GitHub Desktop.
Save mattsan/b414d2313e284915446d659f3ab9d78a to your computer and use it in GitHub Desktop.
Serverless で layers に gems を配置する
service: emattsan
provider:
name: aws
runtime: ruby2.5
stage: ${opt:stage, 'development'}
region: ap-northeast-1
package:
exclude:
- package.json
- yarn.lock
- node_modules/**
- Gemfile*
- vendor/**
# add symbolic link
# $ (mkdir -p layers/ruby/gems && cd layers/ruby/gems && ln -s ../../../vendor/bundle/ruby/2.5.0 2.5.0)
layers:
gems:
path: layers
name: ${self:service}-${self:provider.stage}-gems
compatibleRuntimes:
- ruby2.5
allowedAccounts:
- '*'
functions:
fake:
handler: handler.fake
layers:
- {Ref: GemsLambdaLayer}
hello:
handler: handler.hello
layers:
- {Ref: GemsLambdaLayer}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment