Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
570
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
730
Other Decks in Technology
See All in Technology
Karate+Database RiderによるAPI自動テスト導入工数をCline+GitLab MCPを使って2割削減を目指す! / 20251206 Kazuki Takahashi
shift_evolve
PRO
1
610
AWS Bedrock AgentCoreで作る 1on1支援AIエージェント 〜Memory × Evaluationsによる実践開発〜
yusukeshimizu
6
380
直接メモリアクセス
koba789
0
290
安いGPUレンタルサービスについて
aratako
2
2.7k
AWS CLIの新しい認証情報設定方法aws loginコマンドの実態
wkm2
6
650
Lambdaの常識はどう変わる?!re:Invent 2025 before after
iwatatomoya
1
400
A Compass of Thought: Guiding the Future of Test Automation ( #jassttokai25 , #jassttokai )
teyamagu
PRO
1
250
モダンデータスタック (MDS) の話とデータ分析が起こすビジネス変革
sutotakeshi
0
440
SSO方式とJumpアカウント方式の比較と設計方針
yuobayashi
7
530
今からでも間に合う!速習Devin入門とその活用方法
ismk
1
570
プロダクトマネージャーが押さえておくべき、ソフトウェア資産とAIエージェント投資効果 / pmconf2025
i35_267
2
590
AWS Trainium3 をちょっと身近に感じたい
bigmuramura
1
130
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Statistics for Hackers
jakevdp
799
230k
Unsuck your backbone
ammeep
671
58k
BBQ
matthewcrist
89
9.9k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.7k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.3k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
The Cost Of JavaScript in 2023
addyosmani
55
9.3k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Mobile First: as difficult as doing things right
swwweet
225
10k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
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
デモ