wallix / awless

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

sync does not respect service flag on first run #124

Closed gauravarora closed 7 years ago

gauravarora commented 7 years ago

Because of the problems reported in #116 I would like to run sync on just the infra service but that doesn't seem to be possible on the first run.

Gauravs-MBP:tmp gaurav$ awless --version
awless version=v0.1.1, commit=e4981514f29034deaf6466aff60b9909a0e7810a, build-date=2017-07-06T17:36:39+02:00, build-arch=amd64, build-os=darwin, build-for=brew
Gauravs-MBP:tmp gaurav$ rm -rf ~/.awless/
Gauravs-MBP:tmp gaurav$ awless -e sync --infra
Welcome to awless! Resolving environment data...

Found existing AWS region 'eu-west-1'. Setting it as your default region.
[verbose] loading AWS session with profile 'default' and region 'eu-west-1'
[info]    Syncing new region 'eu-west-1'
[verbose] sync: *disabled* for resource storage[s3object]
[extra]   sync: fetched lambda service took 979.698066ms
[extra]   sync: fetched cloudformation service took 988.276375ms
[extra]   sync: fetched cdn service took 1.019779357s
[extra]   sync: fetched messaging service took 1.239759988s
[extra]   sync: fetched dns service took 1.489029788s
[extra]   sync: fetched storage service took 3m31.735965746s
[extra]   sync: fetched access service took 10m12.25207038s

Additionally, this didn't work either:

Gauravs-MBP:tmp gaurav$ rm -rf ~/.awless/
Gauravs-MBP:tmp gaurav$ awless config set aws.infra.access.sync false
Welcome to awless! Resolving environment data...

Found existing AWS region 'eu-west-1'. Setting it as your default region.
[info]    Syncing new region 'eu-west-1'
simcap commented 7 years ago

Flags in general should be taken into account on the first run, so we will add this behavior.

I note that your command is incorrect, and our documentation should be clearer on that:

awless config set aws.infra.access.sync false should be awless config set aws.infra.sync false or awless config set aws.access.sync false

For sync enabling/disabling the general rule as for now is:

awless config set aws.SERVICE_NAME.[SERVICE_RESOURCE].sync {false,true}

(with [..] an optional value)

Examples: awless config set aws.storage.sync true awless config set aws.storage.s3object.sync false awless config set aws.access.policy.sync false

Also whatever command is given on first install will be run after the sync and auto configuration of awless. So changing the config on first install will be done at the end and will not have the desired effect.

simcap commented 7 years ago

Fixed. (Note the second part of issue description is not relevant anymore)