Cloud Functions 第二世代をコマンドでデプロイしようとしたら unrecognized arguments: –gen2 が発生した

公式の「Google Cloud CLI を使用して Cloud Functions(第 2 世代)の関数を作成してデプロイする」をもとに第二世代をデプロイしようとしてみる。

下記公式抜粋。

gcloud functions deploy python-http-function \
--gen2 \
--runtime=python311 \
--region=asia-northeast1 \
--source=. \
--entry-point=hello_get \
--trigger-http \
--allow-unauthenticated

実行すると下記の通りエラーが発生する。

gcloud functions deploy python-http-function \
--gen2 \
--runtime=python311 \
--region=asia-northeast1 \
--source=. \
--entry-point=hello_get \
--trigger-http \
--allow-unauthenticated
ERROR: (gcloud.functions.deploy) unrecognized arguments: --gen2 
To search the help text of gcloud commands, run:
  gcloud help -- SEARCH_TERMS

gcloud sdk をアップデートする。

gcloud components update
YouTube