Skip to content

Instantly share code, notes, and snippets.

@nikolaymatrosov
Created June 30, 2022 12:37
Show Gist options
  • Save nikolaymatrosov/49a38ccde9291ecc73b791811c031a44 to your computer and use it in GitHub Desktop.
Save nikolaymatrosov/49a38ccde9291ecc73b791811c031a44 to your computer and use it in GitHub Desktop.
API Gateway example
service: bot
frameworkVersion: "3"
provider:
name: yandex-cloud
runtime: golang117
environment:
FOLDER_ID: b1g***
httpApi:
payload: '1.0'
plugins:
- '@yandex-cloud/serverless-plugin'
package:
patterns:
- '!.idea'
- 'go.mod'
- 'functions/**'
- '!package*.json'
functions:
api:
handler: api.ApiHandler
memorySize: 128
timeout: 30
account: bot
events:
- http:
method: get
path: /api
telegram:
handler: telegram.TelegramHandler
memorySize: 128
timeout: 30
account: bot
events:
- http:
path: /telegram/{merchantID}/{channelID}
method: post
request:
parameters:
paths:
merchantID: true
channelID: true
resources:
bot:
type: yc::ServiceAccount
roles:
- editor
- serverless.functions.invoker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment