aws / aws/aws-toolkit-vscode

Toolkit should re-evaluate static credentials file when the file is updated

Open
#2,465 2 comments 1 reaction 0 assignees View on GitHub
auth-credentials feature-request
Dominant language
TypeScript
Stars
2k
Forks
807
Avg merge
10h 12m
Merged PRs (30d)
7

Description

## Problem

There are too many steps to get things back to working again every time the Temporary Credentials( Keyid,Key,Token) for a Permission Set Role for an AWS account expire(default is 4 hrs, since behind the scenes it is nothing but an IAM role). One has to;

1. Pull another set of temporary credentials
1. Update the /.aws/credentials file and replace the Temporary Credentials under the profile that reflects the account the user is working on in the AWS Organization.
1. (This step should be un-necessary and should be removed:) Go back into aws toolkit and Select the exact same Credentials profile name in order to pull the Temporary Credentials from the Credentials file into AWS Toolkit in order for Visual Studio Code to use them instead of the expired ones.
- This step is counter-intuitive and from a UX experience for the presented flow, un-necessary.

## Expected behavior

I want to select the AWS Credential profile ONCE, update it with temporary credentials as much as necessary and never have to update it in Visual Studio Code unless I actually need to change Credential profiles.

Remove step 3 above. Instead, once the user selects the Credentials profile name AWS Toolkit for Visual Studio Code should automatically pull the updated Temporary Credentials allowing the user to continue working uninterrupted.

Why doesn't VS read directly from the credentials file like the SDK does, why does it have to IMPORT the credentials under the select profiles and why does it do it ONLY when a user selects a profile MANUALLY?

For example:
I want AWS SAM Extension to stop giving me errors like this:

```
An error occurred (ExpiredToken) when calling the PutObject operation: The provided token has expired.
at Yn (c:\Users\einar.coutin\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-1.35.0\dist\extension.js:2082:116)
at Hr (c:\Users\einar.coutin\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-1.35.0\dist\extension.js:2082:495)
at Y8 (c:\Users\einar.coutin\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-1.35.0\dist\extension.js:2433:322)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async p7 (c:\Users\einar.coutin\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-1.35.0\dist\extension.js:2453:1829)
at async m7 (c:\Users\einar.coutin\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-1.35.0\dist\extension.js:2453:2770)]
```

Because I forgot to go into the AWS Toolkit page on the left side menu and RE-select the Profile for the account I'm already working on after I've already updated the actual Credentials file.
Just to be clear, this is a problem with AWS Toolkit, NOT AWS SAM for Serverless.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the AWS Toolkit page handles selecting a profile and imports credentials from /.aws/credentials, then compare that flow with the AWS SAM extension's PutObject use case. Update the selected profile's credentials after the file changes without requiring manual reselection, and verify that refreshed temporary credentials prevent the reported ExpiredToken error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript, vscode
Domain
authentication, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.