Cloud Function利用時のSecret Manager登録

Cloud Function利用時のキー情報をSecret Managerに登録するコマンド

# Change the value of an existing secret
firebase functions:secrets:set SECRET_NAME

# Set secret from file
firebase functions:secrets:set SECRET_NAME --data-file file.json

# Validate secret value as json
cat file.json | firebase functions:secrets:set SECRET_NAME --format=json

# Pipe from stdin and set secret
cat file.json | firebase functions:secrets:set SECRET_NAME --format=json

# View the value of a secret
functions:secrets:access SECRET_NAME

# Destroy a secret
functions:secrets:destroy SECRET_NAME

# View all secret versions and their state
functions:secrets:get SECRET_NAME

# access コマンドと destroy コマンドでは、オプションのバージョン パラメータを指定することによって、
# 特定のバージョンを管理できます。次に例を示します。
functions:secrets:access SECRET_NAME[@VERSION]