SORACOMからGCP Pub/Sub、CloudFunctions、Firestore、GoogleSheets連携関連情報

SORACOM -> GCP 連携設定

Soracom Google Cloud Pub/Sub アダプターを使用する https://users.soracom.io/ja-jp/docs/funnel/google-cloud-pubsub/

ボタンと Google Cloud Functions 連携をすばやく構築したい ― SORACOM Funk + Google Cloud Functions パターン https://users.soracom.io/ja-jp/guides/design-patterns/button/gcp/

Functions単体

【011】Cloud Functionsの概要【Firebase】 (わかりやすい) https://youtu.be/z8lVQQtUNJc

【Firebase】Cloud Functions チュートリアル 電子書籍(500円) https://zenn.dev/tentel/books/a96e4a64d3a672911f25

Pub/Sub -> CloudFunctions -> Firestore

※PubSub -> DataFlow -> BigQuery の連携も検討したが、DataFlowが0.4ドル/1時間とコストかかる。 (リアルタイム処理ではなく、バッチ処理にすると安くなるらしいがやり方が不明)

Cloud Functions- moving data from Pubsub to Firebase Cloud Firestore in TypeScript - YouTube https://www.youtube.com/watch?v=3Zohd6U6CL8

Firestore -> CloudFunctions -> GAS(GoogleSheets)連携

Cloud Functions for Firebaseでスプレッドシートに書き込む (サービスアカウントを使用する方法:一番参考になった) https://qiita.com/m_norii/items/63cc8f5eb91a3fc5505f

FirebaseからGoogleSpreadSheetに書き込みをし、その更新をメール通知する (googleapi,サービスアカウントを使用する方法:参考になった) https://qiita.com/shotashimura/items/65d149b74297cebd0d7a

GAS(Google Apps Script)でCloud Firestoreを利用する時のメモ (GASにライブラリ追加、サービスアカウントを使用する方法) https://qiita.com/PmanRabbit/items/a76b9bc5a9d0239c9f78

Google BigQueryへのデータ連携(WebioというIoT端末から連携する方法) https://webiot.io/docs/guide/bigquery/

Official の方法を採用する(OAUTHを使用する方法) https://github.com/firebase/functions-samples/tree/main/google-sheet-sync https://medium.com/@elon.danziger/fast-flexible-and-free-visualizing-newborn-health-data-with-firebase-nodejs-and-google-sheets-1f73465a18bc https://github.com/firebase/functions-samples/blob/main/google-sheet-sync/functions/index.js

Firebase公式ビデオ(Firestore for Google Apps Scriptsを使用する方法) Multi-factor authentication update, Firestore data into Google Sheets, & more! https://www.youtube.com/watch?v=TD3kWcb2TH0

GCP IoTのチュートリアル

IoT in the Google Cloud 7時間 クレジット: 46 https://www.qwiklabs.com/quests/49