本編
事の発端
cloud functions で "Your proposed upload is larger than the maximum object size specified in your Policy Document."
と言われた。
なんでもかんでも同じプロジェクト内に functions のコードを追加し続けたら以下のエラーで怒られた。
Status: [400:<?xml version='1.0' encoding='UTF-8'?><Error><Code>EntityTooLarge</Code><Message>Your proposed upload is larger than the maximum object size specified in your Policy Document.</Message><Details>Content-length exceeds upper bound on range</Details></Error>]
きれいにプロジェクトを分割して保守性を高めなければなあ。
と思いつつもソースコードに割り当てられているストレージのサイズを挙げて応急処置。
と思いきや…
コードのサイズ的な項目がない…????
ドキュメントを参照してみると…
割り当て | Cloud Functions のドキュメント | Google Cloud
できない!!!
おとなしく function ごとに分割してプロジェクトを作り直します。
追記
pipenv を導入した際に venv
ディレクトリが生成されたのを完全に忘れていた。(そらサイズも大きいわ。)
.gcloudignore
ファイルに以下を追記して解決された。
(ついでに 動作確認で使っていた jupyter のファイルたちもアップロードしないように変更)
.gcloudignore
...
# jupyter notebooks
*.ipynb
# pipenv
venv
...