MitocGroup / deepify

software development tool-chain that abstracts package management of cloud native web applications
https://www.deep.mg
Mozilla Public License 2.0
3 stars 0 forks source link

Improve deepify list output #383

Closed eistrati closed 7 years ago

eistrati commented 7 years ago
  1. Add "Querying AWS region (or regions) and compiling the list of applications..." message, so that users don't wait thinking that something is broken
  2. Add --regions parameter and allow comma separated values as list of regions (use * for all regions)
  3. Change "To get more details, run deepify list --depth=2 or deepify list --depth=3" to "Below output is consolidated. Use parameters like --depth or --regions to get more details, but be aware that it takes considerably more time. \n Run deepify list --depth=2 to get service level details. And, deepify list --depth=3 to get resource level details."
  4. Change "[blablabla] region applications:" to "########### \n REGION: [blablabla]" (make sure that number of hash signs matches to number of chars in next row REGION: [blablabla])

I would propose the following output:

MitocGroup:~ eugene$ deepify list
15:27:00 GMT-0400 (EDT)  Querying AWS region (or regions) and compiling the list of applications...
15:27:56 GMT-0400 (EDT)  Below output is consolidated. Use parameters like --depth or --regions to get more details, but be aware that it takes considerably more time.
15:27:57 GMT-0400 (EDT)  Run deepify list --depth=2 to get service level details. And, run deepify list --depth=3 to get resource level details.
##############
REGION: global

#1. Application 430f1fff | using 1 cloud services
    ---------------------------------------------

#################
REGION: us-east-1

#1. Application 1558a2a9 | using 10 cloud services
    ----------------------------------------------

#2. Application 370b9c50 | using 9 cloud services
    ---------------------------------------------

#3. Application 3e4186ab | using 12 cloud services
    ----------------------------------------------

#4. Application 41ae5689 | using 9 cloud services
    ---------------------------------------------

#5. Application 55182282 | using 10 cloud services
    ----------------------------------------------

#6. Application 9d71cad5 | using 10 cloud services
    ----------------------------------------------

#################
REGION: us-west-1

#1. Application 940b2dac | using 3 cloud services
    ---------------------------------------------

#################
REGION: us-west-2

#1. Application 3ff0c1a8 | using 1 cloud services
    ---------------------------------------------

#2. Application 61ddb20b | using 1 cloud services
    ---------------------------------------------

#3. Application 650e744f | using 1 cloud services
    ---------------------------------------------

#4. Application 6f01f171 | using 1 cloud services
    ---------------------------------------------

#5. Application 805cc06d | using 1 cloud services
    ---------------------------------------------

#6. Application 8230ea68 | using 1 cloud services
    --------------------------------------------- 
eistrati commented 7 years ago

I'd like to challenge / ask if default value for region should be 'us-east-1' or '*'. What do you guys think @mgoria @AlexanderC @ddimitrioglo ?

eistrati commented 7 years ago

One more idea: Can we query Route53 based on some metadata from CloudFront or S3, in order to identify and output the CNAME or A ALIAS record, if available?

ddimitrioglo commented 7 years ago
  1. It would be cool it be "*" right after installation, but also be a command like deepify config set region='us-east-1' to adjust for user's needs.

  2. By cloudfront ID we can get it's aliases:

    
    aws cloudfront get-distribution --id X88XX8XX8888XX --query "Distribution.DistributionConfig.Aliases.Items[]"

// output [ "example.com" ]


and then for each alias we can get `RecordSetCount`:

aws route53 list-hosted-zones --query="HostedZones[].{ResourceRecordSetCount: ResourceRecordSetCount, Name: Name}[?contains(Name, 'example.com')] | [0]"

// output: { "ResourceRecordSetCount": 32, "Name": "example.com." }


P.S. At least for first level domains, and at least from AWS CLI
mgoria commented 7 years ago
  1. I'm for * as default region for listing, don't want to make any privileges for us-east-1 :)

  2. I guess it's feasible, if it's possible from cli it should be also available in nodejs sdk

avozicov commented 7 years ago

Test Passed

screen shot 2017-07-17 at 18 53 53
avozicov commented 7 years ago

@eistrati I have tested all the scenarios from task description and test passed. (please refer to the screenshots above)

Please let me know if separate task should be opened for this purposes.