aws_refresh_if_expiring_soon
Check the cached AWS SSO token and start re-authentication if fewer than a set number of minutes remain, preventing mid-workflow expiry.
Instructions
Proactive SSO token check. If the cached token has fewer than thresholdMinutes left (default 10), this kicks off aws_login_start and returns the verification URL + code in one round-trip. If plenty of time remains, returns status: 'ok' with the minutes left. Use at the start of a multi-step AWS workflow to avoid mid-session expiry. status: 'ok' is a point-in-time reading of the cache, not a lease: nothing re-checks afterwards, so a token that lapses mid-workflow still surfaces as an sso_expired error from the next aws_call / aws_whoami. Raise thresholdMinutes to cover the expected length of the workflow rather than treating 'ok' as a guarantee.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | AWS profile configured for SSO. Defaults to $AWS_PROFILE or 'default'. | |
| thresholdMinutes | No | Trigger refresh when the token has fewer than this many minutes left. Default 10. |