Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API call to determine the latest version #7792

Closed
2 tasks
NothinRandom opened this issue Mar 29, 2023 · 4 comments
Closed
2 tasks

API call to determine the latest version #7792

NothinRandom opened this issue Mar 29, 2023 · 4 comments
Assignees
Labels
feature-request A feature should be added or improved. p3 This is a minor priority issue

Comments

@NothinRandom
Copy link

Describe the feature

An API call to allow end user to determine the latest version of the agent. We can model this call similarly to other teams such as codedeploy or ssm, where running a command similar to this retrieves the latest version curl -s https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/VERSION.

Use Case

Downloading the installer can take some time and also consumes unnecessary bandwidth if the agent is already up to date.

One way is to query the change log and grep the 5th line to determine the latest version via:
curl -s "https://raw.githubusercontent.com/aws/aws-cli/v2/CHANGELOG.rst" | sed -n '5p'

The bruteforce way is to download the latest agent and determine the version after extraction via:

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
./aws/dist/aws --version

As you can notice, neither method seems official for a widely used agent... rather both are workarounds because there is no official way of retrieving the latest version.

Proposed Solution

We can model this call similarly to other teams such as codedeploy or ssm, where a simple and negligible bandwidth consuming call can retrieves the latest version. For example, an end user can retrieve the latest version of AWS SSM via making this call curl -s https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/VERSION which outputs 3.2.582.0. Similarly for codedeploy agent, making this call curl -s "https://aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com/latest/LATEST_VERSION" outputs {"rpm":"releases/codedeploy-agent-1.5.0-57.noarch.rpm","deb":"releases/codedeploy-agent_1.5.0-57_all.deb","msi":"releases/codedeploy-agent-1.5.0.57.msi"}.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CLI version used

2.11.6

Environment details (OS name and version, etc.)

Ubuntu 20.04.x, Ubuntu 22.04.x, Debian 11

@NothinRandom NothinRandom added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Mar 29, 2023
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Mar 29, 2023
@RyanFitzSimmonsAK RyanFitzSimmonsAK added needs-review This issue or pull request needs review from a core team member. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. needs-review This issue or pull request needs review from a core team member. labels Mar 29, 2023
@RyanFitzSimmonsAK
Copy link
Contributor

Hi @NothinRandom, thanks for this feature request. When I brought this up with the team, they did mention that all releases have version tags, and that the version is also in the __init__.py. So, you could get the version using something like curl -s https://raw.githubusercontent.com/aws/aws-cli/v2/awscli/__init__.py | find "__version__". Hopefully this workaround is a slight improvement over the changelog for you.

@NothinRandom
Copy link
Author

Hey Ryan. I would say that this version to be more work (less improvement I guess) over the change log since you see to grep the line and then sed to replace __version__ and the single quotes. I think I'll stick with the change log for now. Hopefully then team will reconsider and incorporate this feature request down the road like the other AWS services. I guess we can close this ticket for now. Thanks for looking in this!

@Frankgad
Copy link

Hi,
actually if the releases page in github was updated properly, the latest version could be easily retrieved from api.github.com
for example: https://api.github.com/repos/hashicorp/terraform/releases/latest

@RyanFitzSimmonsAK RyanFitzSimmonsAK closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

3 participants