cesanta / mos-tool

The Mongoose OS command line tool
https://mongoose-os.com/software.html
24 stars 15 forks source link

Feature Request - accept equivalent of aws CLI --profile in mos aws-iot-setup #17

Open EldritchJS opened 6 years ago

EldritchJS commented 6 years ago

It would be great if the mos tool would allow for using the equivalent of aws cli's --profile when using aws-iot-setup.

Looks like at least the following would be necessary:

  1. Accept a --profile <PROFILE_NAME> arg when mos aws-iot-setup is called

  2. If a profile arg was provided, add --profile <PROFILE_ARG> to https://github.com/cesanta/mos-tool/blob/e5f7d54b2ac946728880cfdab16a919d5b7ac775/mos/aws/aws.go#L80 for the region acquisition

  3. Use the same approach for getting aws_access_key_id and aws_secret_access_key as is used currently for getting the default AWS region (i.e. calling getCommandOutput()) and then assigning those results to the appropriate members of the cfg.Credentials object. All with the same potential use of --profile <PROFILE_ARG> as in point 2 above

KyleVest commented 5 years ago

We use a QA and PRODUCTION AWS environment so being able to specify the profile name would be very nice.

gadget-man commented 5 years ago

This would be useful for me - I'm having to change between Prod and Dev environments.

stevefister commented 2 years ago

@rojer I see you committed the change for --aws-profile. It doesn't seem to be working in 2.19.0. I have the AWS CLI configured with a default profile, but this flag seems to be completely ignoring it.