Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
GCPと連携してマスターデータ更新
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
SatohJohn
November 02, 2022
Programming
250
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GCPと連携してマスターデータ更新
[GDG Osaka] GASによる業務改善勉強会で発表をした内容になります。
https://gdgosaka.connpass.com/event/261885/
SatohJohn
November 02, 2022
More Decks by SatohJohn
See All by SatohJohn
BigQuery を検索ソースとした AI Agent の作り方って 〇〇 通りあんねん
satohjohn
0
230
Claude Codeで評価を楽にする
satohjohn
0
110
A2UI という光を覗いてみる
satohjohn
1
240
_Architecture_Modernization_から学ぶ現状理解から設計への道のり.pdf
satohjohn
2
1.3k
アーキテクチャモダナイゼーションを実現する組織
satohjohn
1
1.7k
Vertex_AI_Searchを使いこなす実践テクニック
satohjohn
1
300
アーキテクチャモダナイゼーションの書籍紹介
satohjohn
0
84
NVIDIA NeMo Agent Tooklit を使ってみた
satohjohn
0
170
Gemini Enterprise を恐れない - Securityと監査-
satohjohn
0
240
Other Decks in Programming
See All in Programming
Workers Cache を知る
syumai
0
320
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
190
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
19
20k
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
120
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.6k
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
480
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
330
Intent as Code
shoppingjaws
6
1.1k
Security issues being discussed on Web Platforms
petamoriken
0
1.4k
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
750
Heart of Swift Concurrency
koher
0
1.1k
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
1k
Featured
See All Featured
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
860
ラッコキーワード サービス紹介資料
rakko
1
5.1M
The Invisible Side of Design
smashingmag
301
52k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Design in an AI World
tapps
1
340
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
600
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Odyssey Design
rkendrick25
PRO
2
850
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
750
Product Roadmaps are Hard
iamctodd
55
13k
Transcript
GCPと連携して マスターデータ更新 [GDG Osaka] GASによる業務改善勉強会 2022/11/02 佐藤慧太
軽い自己紹介 - 佐藤慧太( @SatohJohn ) - フリュー株式会社 ( 渋谷 )
- 社内でGCPの営業として 活動しています
新規事業とかで Spread Sheetでマスターデータ管理 ってよくやりますよね
で、Masterデータをもとに DBを更新するじゃないですか
でも、DBはprivate IPしか許可せず 直接繋げないんです
そんなときに Cloud Functionを通して DBを叩く!
つまり セキュリティの硬いDBに対して Serverless VPCを通した Cloud Functionを通して アクセスする
メリット - 運用メンバー、企画メンバーが書いているスプレッドシートをそのままMasterとして 利用できる - GCPのアプリケーションからFunctionsやCloudRunなどを叩くことができる - 複雑な処理を書ける - 認証通せるので、関数自体は叩かれまくることはなく安全
- GASを叩ける人を決められる (spread sheetの共有とGASを叩く人が違う場合)
デメリット - 1GCPプロジェクトしか紐付けできない - 開発系と本番系とー、ってなるとめんどい。 VPCを色々イジる必要がある。
構成
やりかた
やりかた(GASとGCPを紐付ける1) GASの方でプロジェクトの認証をする (projectIDじゃなくプロジェクト番号なの注意)
やりかた(GASとGCPを紐付ける2) GCP Projectの方でクライアントが自動的に作られる
やりかた(GASとGCPを紐付ける3) OAuth同意画面で公開ステータス「テスト」 ってなっている場合、 テストユーザを追加する
やりかた(Functionを作る) 認証ありでCloud Functionを作成する(ここは自由、ただし私はNode.jsが好きです)
やりかた(GASを作る) // Cloud Functionsとの接続 / Cloud Functionsに対して、HTTPトリガーの発火をする function post(payload) {
const url = "https://hogehoge" const token = ScriptApp.getIdentityToken() UrlFetchApp.fetch({ url, method: 'post', payload: JSON.stringify(payload), contentType: 'application/json', headers: { Authorization: `Bearer ${token}` } }) } ScriptAppのgetIdentityTokenをつかって認証ができる!
実行をしよう
実行をしよう
感じたこと - 思ったよりもかんたんに実装ができるぞ - 今まで、GCPプロジェクト側からSpread Sheetへの参照をしていた - service accountの作成して、spread sheetに参照権限もたせてた
- GCPの「組織」を使ってやると、公開アプリケーションとして配布できるのでなんか 色々できる - と思う
おしまい