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