Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
LT_Cloud_Functions.pdf
Search
Masaki Iino
September 08, 2017
Technology
1
580
LT_Cloud_Functions.pdf
社内LT用
Masaki Iino
September 08, 2017
Tweet
Share
More Decks by Masaki Iino
See All by Masaki Iino
GCP Composer
iinomasaki
0
250
AnyPay ChatOps
iinomasaki
0
1.2k
Istio
iinomasaki
0
1.6k
GolangでAPIドキュメント自動生成
iinomasaki
0
740
Other Decks in Technology
See All in Technology
いよいよ仕事を奪われそうな波が来たぜ
kazzpapa3
3
300
Tebiki Engineering Team Deck
tebiki
0
23k
全員が「作り手」になる。職能の壁を溶かすプロトタイプ開発。
hokuo
1
630
DatabricksホストモデルでAIコーディング環境を構築する
databricksjapan
0
210
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
170
Riverpod3.xで実現する実践的UI実装
fumiyasac0921
2
360
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.8k
セキュリティ はじめの一歩
nikinusu
0
1.2k
IaaS/SaaS管理における SREの実践 - SRE Kaigi 2026
bbqallstars
0
350
月間数億レコードのアクセスログ基盤を無停止・低コストでAWS移行せよ!アプリケーションエンジニアのSREチャレンジ💪
miyamu
0
230
2人で作ったAIダッシュボードが、開発組織の次の一手を照らした話― Cursor × SpecKit × 可視化の実践 ― Qiita AI Summit
noalisaai
1
300
Mosaic AI Gatewayでコーディングエージェントを配るための運用Tips / JEDAI 2026 新春 Meetup! AIコーディング特集
genda
0
130
Featured
See All Featured
ラッコキーワード サービス紹介資料
rakko
1
2.1M
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
230
Code Reviewing Like a Champion
maltzj
527
40k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
110
GitHub's CSS Performance
jonrohan
1032
470k
We Have a Design System, Now What?
morganepeng
54
8k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Are puppies a ranking factor?
jonoalderson
1
2.6k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.9k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
Abbi's Birthday
coloredviolet
1
4.6k
Transcript
Cloud Functions Masaki Iino
Cloud Functions Cloud Functions β版 βリリース時にFirebaseもサポートされた ぼちぼち、GAになるらしい
Cloud Functions • サーバレス • イベント駆動 • ステートレス • Node.js
料金体系
関数の種類 • HTTP Functions ◦ HTTPSリクエストがトリガー ◦ 同期実行 • Background
Functions ◦ Cloud Pub/Sub ◦ Cloud Storage ◦ 非同期実行
HTTP Functions Hello World するならこう 内部的にExpressを使用している exports.helloWorld = function helloWorld
(req, res) { res.send('Hello World!'); };
HTTP Functions デプロイ方法 アップロードするバケットとトリガーを指定 バケットは先に作っておく必要あり $ gcloud beta functions deploy
helloWorld \ --stage-bucket functions-helloWorld \ --trigger-http
Background Functions Hello World するならこう 最後にcallbackを呼ぶ exports.helloWorld = function helloWorld
(event, callback) { callback(); };
Background Functions デプロイ方法 アップロードするバケットとトリガーを指定 $ gcloud beta functions deploy helloWorld
\ --stage-bucket functions-helloWorld \ --trigger-bucket my-bucket $ gcloud beta functions deploy helloWorld \ --stage-bucket functions-helloWorld \ --trigger-topic my-topic
パッケージ package.jsonを記述すれば、クラウド上でnpm installされる。 "dependencies": { "request": "^2.81.0" }, const request
= require('request'); exports.helloWorld = function helloWorld (req, res) { request('http://www.google.com', (error, response, body) => { res.send('Hello World!'); } };
ログ Stackdriver Loggingに出力される(console.logを使う)
モニタリング 呼び出し回数 / 実行時間 / メモリ使用量
開発環境 公式のエミュレータがあります。(まだalpha
デモ