wallix / awless

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

Securitygroup by name does not work as default #265

Open poma opened 5 years ago

poma commented 5 years ago

Specifying default security group by name does not work, but specifying it explicitly does:

$ awless config | grep securitygroup
   securitygroup.protocol:   tcp                       (string)   # The IP protocol to authorize on the security group
   instance.securitygroup:   @all              (string)
[info]    region precedence: 'eu-west-1' loaded through AWS_DEFAULT_REGION variable

$ awless create instance name=test
[info]    Image ami-01e6a0b85de033c99 resolved for distro 'canonical:ubuntu:bionic' (expanded to 'canonical:ubuntu:bionic:x86_64:hvm:ebs')
[error]   dry run: create instance: InvalidParameterCombination: The parameter groupName cannot be used with the parameter subnet
    status code: 400, request id: 074b321e-9953-4d51-ab52-746991ebaa9c
[error]   Dry run failed

$ awless create instance name=test securitygroup=@all
[info]    Image ami-01e6a0b85de033c99 resolved for distro 'canonical:ubuntu:bionic' (expanded to 'canonical:ubuntu:bionic:x86_64:hvm:ebs')
create instance count=1 image=ami-01e6a0b85de033c99 keypair=poma name=test securitygroup=sg-097c212a22cef87c9 subnet=subnet-855ed3e2 type=t2.micro

Confirm (region: eu-west-1)? [y/N] ^C

I also tried name without @ but it also does not work. Specifying default security group by id works.