()
| 59 | * This ensures that any changes to ~/.aws/credentials are picked up immediately |
| 60 | */ |
| 61 | export async function clearAwsIniCache(): Promise<void> { |
| 62 | try { |
| 63 | logForDebugging('Clearing AWS credential provider cache') |
| 64 | const { fromIni } = await import('@aws-sdk/credential-providers') |
| 65 | const iniProvider = fromIni({ ignoreCache: true }) |
| 66 | await iniProvider() // This updates the global file cache |
| 67 | logForDebugging('AWS credential provider cache refreshed') |
| 68 | } catch (_error) { |
| 69 | // Ignore errors - we're just clearing the cache |
| 70 | logForDebugging( |
| 71 | 'Failed to clear AWS credential cache (this is expected if no credentials are configured)', |
| 72 | ) |
| 73 | } |
| 74 | } |
no test coverage detected