wallix / awless

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

please return ChangeInfo.Id in response to awless create record #80

Closed lakamsani closed 7 years ago

lakamsani commented 7 years ago

Hi, for this kind of command: awless create record type=A name=host.domain.com value=1.2.3.4 ttl=60 zone=Z12345 if you could return ChangeInfo.Id that would be helpful in scripts that want to do some actions later on using the new DNS name. I assume that command is using something like aws route53 change-resource-record-sets under the hood but definitely easier to use as we can simply supply the args on the command line instead of a json file.

The ChangeInfo.Id can be used for example check the status using aws route53 get-change --id <change-set-id> before doing other stuff with the new name.

fxaguessy commented 7 years ago

This has been added to master and will be in next release. When you run a create command, for example, you have the id between []:

create record name=XXXXXX ttl=60 type=CNAME value=XXXX zone=/hostedzone/XXXX

Confirm? (y/n): y
[info]    Executed:
    OK  create record name=XXXXXX ttl=60 type=CNAME value=XXXX zone=/hostedzone/XXXXX   [/change/XXXXX]

[info]    Revert this template with `awless revert 01BBEJ74T0ZQ9HRHQF4BXXMEPK
lakamsani commented 7 years ago

Thank you very much. Is there a flag to skip the 'Confirm?' prompt?

simcap commented 7 years ago

Not yet but we intend to create one. It would be --force, -f mostly used on the awless run command. If you see other use cases let us know.

lakamsani commented 7 years ago

for awsless create and awless delete too especially for DNS records which are easy to recreate even if there is an 'oops' situation.

simcap commented 7 years ago

Yes of course.

I forgot of course to mention all the one-liners templates create, delete, .... (you can see them in the main menu under One-liner Template Commands:). So basically to sum up all operations involving resources creation, update, delete.