0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ServerlessFrameworkでfunction毎にデプロイするファイルを指定する方法

Posted at
  1. package > individually をtrueに設定し、個別のfunctionのデプロイ対象設定を有効化
  2. package > excelude で./**(全ファイル) を設定し、全ファイルをデプロイ対象から除外
  3. functions > 個別のfunction > package > include でデプロイしたいファイルを指定
  4. zipファイルなどをデプロイしたい場合は functions > 個別のfunction > package > artifact で指定
serverless.yml
service: serverless-sample

frameworkVersion: '2'

package:
  individually: true # 1
  exclude: # 2
    - ./**

functions:
  hello:
    handler: src/hello/handler.hello
    events:
      - http:
          path: hello
          method: get
    package: # 3
      include:
        - src/hello/**
  hello2: 
    handler: src/hello2/handler.hello2
    events:
      - http:
          path: hello2
          method: get
    package: # 3
      artifact: dist/hello2.zip

参考

公式 https://www.serverless.com/framework/docs/providers/aws/guide/packaging/

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?