Closed jamesls closed 8 years ago
Awesome, this will be a great addition. Couple questions:
$ aws-shell aws> .profile Current shell profile: no profile configured You can change profiles using: .profile profile-name
If the user doesn't specify a profile, should the default profile automatically be chosen? Or is that what is meant by "no profile configured"?
Curious what the user sees if an invalid profile is specified. Let's say 'default' and 'prod' are available but 'beta' is chosen.
I'm a little short on time this morning, lots of PRs to review :) usually I'd do more testing myself.
:shipit:
If the user doesn't specify a profile, should the default profile automatically be chosen? Or is that what is meant by "no profile configured"?
If no profile is specified in the shell (via aws-shell --profile
or .profile
), then we'll fall back to the logic in the AWS CLI, which will first look at AWS_DEFAULT_PROFILE
before falling back to the default
profile if it exists. If there's no default profile we'll start looking at other credential providers for credentials.
Curious what the user sees if an invalid profile is specified. Let's say 'default' and 'prod' are available but 'beta' is chosen.
There's no validation at the time of switching profiles that the profile does not exist, you'll just get an error when you try to make a CLI call. The previous PR fixes the issue with crashing if we can't create a client, which would also cover this case. I think it'd be cool to autocomplete profile names in the future.
Right now, here's the behavior:
$ aws-shell
aws> .profile badprofile
Current shell profile changed to: badprofile
aws> s3 ls
The config profile (badprofile) could not be found
aws> iam delete-user --user-name #<--- no autocomplete happens because we can't create a client for the "badprofile" profile
Merged via 65d4917
This PR adds profile support:
--profile
argument to start the AWS Shell with a specific profile (#89).profile
dot command to query and change the current profile (#9)Using the new argument:
Using the dot command:
Because this is using the updated internal APIs from the server side completion fix, this PR is using
server-side-fix
as the base branch to make it easier to review.