mantil-io / mantil

Build your AWS Lambda-based Go backends quicker than ever
https://www.mantil.com
MIT License
109 stars 3 forks source link

Setup command should discover AWS credentials from env and .aws #10

Closed IvanVlasic closed 3 years ago

IvanVlasic commented 3 years ago

If environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set use them.

If AWS config file with single default profile exists use that profile. If multiple profiles exists and AWS_PROFILE is set use that profile.

AWS_PROFILE=org5 mantil bootstrap

If multiple AWS profiles exists, and there is no AWS_PROFILE environment variable set then ask. There should be way to disable all interactive questions -q --quiet.

If no AWS account credentials could be found show message and explain how user can help themselves. If region is not set ask with list of all known AWS regions.

Before going further with bootstrapping show which account id will be used in which region and ask for confirmation.

ianic commented 3 years ago

As a principle we should never use any user credentials for which we didn't get permission. Command line tools should not ask questions if not in interactive mode.

Currently I'm thinking about something like this:

mantil setup --aws_profile=org5
mantil setup --aws_access_key= --aws_secert_key=
mantil setup --use_env (use aws credentials from environment)
ianic commented 3 years ago

Redesigned in 20