wallix / awless

A Mighty CLI for AWS
http://awless.io/
Apache License 2.0
4.97k stars 263 forks source link

Ability to show public AMIs #195

Open nhandler opened 6 years ago

nhandler commented 6 years ago

Currently, running awless show against a public AMI id will fail saying it can't find the resource in the current region/profile. I can see how including these images in list output would be noisey, but being able to show them would be really nice to have (possibly with a command line flag to avoid confusion as to whether or not the image exists within the current account).

simcap commented 6 years ago

@nhandler Excuse the delay, I took some time off.

Indeed, currently with awless we list images with awless list images which will only list behind the scenes all images with owner=self. So basically it lists your images. With the show command it only references syncable data (i.e. data that is fetchable and that we choose to put in the local graph). So obviously we do not want to store generic/public AMIs in the local data. At the moment only self images are syncable and therefore stored meaning you can only show those ones. (Note that awless show first look locally and if it cannot find it then do a sync on the relevant data and try to show it again.)

So first thing I think we should add a owner column so that it is clear what is listed. Owner value can be self, amazon, aws-markeplace, microsoft, etc. and an account ID.

Then if we update the fetch code to take into account the --filter owner=amazon given when doing a listing (since this value would now be a valid column) we could fetch new types of AMIs. By default, of course the owner would be set to self.

Also, fetching generic AMIs with no filter on their properties gives back to much tabular data. There need to be some restriction on the call either with:

Apart from a general AMIs search, if you have a specific DevOps use case on why the listing of public AMIs, showing its properties and all is necessary for you ... that could help us better implement what is needed.

nhandler commented 6 years ago

Here is one sample use case. When using Packer to bake AMIs, you are able to specify a source AMI to bake on top of. It can be useful to set the public Ubuntu images published by Canonical as a source. Finding the ID currently requires using the AWS console. This ID then gets hardcoded into various pieces of your infrastructure as code. It would be useful to be able to do awless show ami-#### when reviewing this code to verify that it is in fact the expected/correct image.

jbialy commented 6 years ago

@simcap It's be great to have the ability to list public images using something like --filter owner=amazon etc. Any progress on this?

simcap commented 6 years ago

@jbialy Unfortunately, although I would like to still have the time to contribute to awless, I am not working on this Wallix sponsored project anymore. And I do not know who/when is going to follow suit with it.

jbialy commented 6 years ago

Are PRs still welcome? 😄 This is a pretty great tool, hopefully it can live on!