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
580
1
Share
LT_Cloud_Functions.pdf
社内LT用
Masaki Iino
September 08, 2017
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
750
Other Decks in Technology
See All in Technology
Kiro Meetup #7 Kiro アップデート (2025/12/15〜2026/3/20)
katzueno
2
270
Datadog で実現するセキュリティ対策 ~オブザーバビリティとセキュリティを 一緒にやると何がいいのか~
a2ush
0
180
AWS Systems Managerのハイブリッドアクティベーションを使用したガバメントクラウド環境の統合管理
toru_kubota
1
190
FastMCP OAuth Proxy with Cognito
hironobuiga
3
230
Bref でサービスを運用している話
sgash708
0
210
パワポ作るマンをMCP Apps化してみた
iwamot
PRO
0
250
MCPで決済に楽にする
mu7889yoon
0
160
GitHub Copilot CLI で Azure Portal to Bicep
tsubakimoto_s
0
300
AI時代のシステム開発者の仕事_20260328
sengtor
0
320
【AWS】CloudTrail LakeとCloudWatch Logs Insightsの使い分け方針
tsurunosd
0
130
スケーリングを封じられたEC2を救いたい
senseofunity129
0
130
「できない」のアウトプット 同人誌『精神を壊してからの』シリーズ出版を 通して得られたこと
comi190327
3
370
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
310
Game over? The fight for quality and originality in the time of robots
wayneb77
1
150
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
180
How GitHub (no longer) Works
holman
316
150k
The Limits of Empathy - UXLibs8
cassininazir
1
280
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
68
38k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Designing Powerful Visuals for Engaging Learning
tmiket
1
320
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
350
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
How to train your dragon (web standard)
notwaldorf
97
6.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
デモ