Skip to content

[v2] Implement update command#10475

Open
hssyoo wants to merge 1 commit into
v2from
update-cmd
Open

[v2] Implement update command#10475
hssyoo wants to merge 1 commit into
v2from
update-cmd

Conversation

@hssyoo

@hssyoo hssyoo commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Implements aws update command to download and install the latest AWS CLI v2 version. Also change Linux and macOS post-install scripts to write install-time metadata at install.json.

At a high-level, the command does the following:

  1. Look for install-time metadata in install.json to see if there's a record of the exact install and bin path of the current CLI instance.
    a. Unix should always have it since this PR also introduces post-install changes that ensure install.json is written. One caveat is that the bin directory may not have been recorded (if the user manually set up symlinks). In that case, the command skips setting up a symlink. This is fine since the user-created symlink will still point to the install directory that we're writing over.
    b. Windows may not necessarily have it because there's no Windows post-install script that creates one in the case that the MSI was used directly (ie without an install script or update command). This is fine because Windows MSIs install to predetermined paths.
  2. Check install.json to see if the current instance was a system install. If unavailable, then a best effort will be made based on the current CLI path.
  3. Download the relevant install script and execute it using parameters determined from previous steps.
    a. Unix updates are straightforward since the OS caches the inode and so it can be updated in-place while the updated exe is still running.
    b. Windows is trickier since the process acquires a lock on the exe. To work around this, the parent process exits early after launching a detached subprocess that handles the install execution.

@hssyoo hssyoo requested a review from a team as a code owner July 7, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant