ti fs refresh-file-system-token
指定した file system トークンをローテーションし、その置き換え値を 1 回だけ返します。以前の値は、認証の変更が反映された後に機能しなくなります。反映には約 10 秒かかる場合があります。
構文
ti fs refresh-file-system-token
[--file-system-id <string>]
[--fs-token <string>]
[--ttl <duration>]
[--dry-run]
[--help]
[--version]
オプション
--file-system-id <string>: 指定したトークンからデコードされた file system ID を検証します。ローカルで選択されたトークンを読み込む場合、このオプションは必須です。--fs-token <string>: 現在のトークンを指定します。シェル履歴やプロセス一覧への露出を避けるため、TI_FS_TOKENの使用を推奨します。デフォルトでは、まずTI_FS_TOKENを使用し、次に選択されたローカル認証情報を使用します。--ttl <duration>: 新しい正の有効期間を秒単位で設定します。最大は 365 日です。以前の有効期間を維持する場合は省略してください。--dry-run: トークンをローテーションせずに、トークンの選択、リージョン、TTL、および既知のローカルマウント競合を検証します。--help: ヘルプ情報を表示します。--version: バージョン情報を表示します。
すべてのコマンドで共通のオプションについては、グローバルオプション を参照してください。
例
選択されたローカル認証情報を更新します。
# ti atomically replaces the local credential after receiving the new token. ti fs refresh-file-system-token --file-system-id "<file-system-id>"シークレットマネージャーから提供されたトークンを更新します。
# Read the current token without echoing it or storing it in shell history. printf 'Current FS token: ' >&2 read -r -s TI_FS_TOKEN printf '\n' >&2 export TI_FS_TOKEN # Capture the one-time replacement and update the external secret manager yourself. TI_REGION_CODE="aws-us-east-1" \ ti fs refresh-file-system-token > ./refreshed-token.json unset TI_FS_TOKEN更新中にトークンの有効期間を変更します。
# Read the current token without echoing it or storing it in shell history. printf 'Current FS token: ' >&2 read -r -s TI_FS_TOKEN printf '\n' >&2 export TI_FS_TOKEN # Rotate the token and set its new lifetime to 30 days. TI_REGION_CODE="aws-us-east-1" \ ti fs refresh-file-system-token --ttl 720h unset TI_FS_TOKEN