Using AssumeRole, accept IAMRole and log in to the AWS management console.
- Print Help.
$ awslogin -h
Usage:
-l Print available ARN list and quit. (Short)
-list
Print available ARN list and quit.
-r string
Use IAM-Role. (Short)
-rolename string
Use IAM-Role.
-v Print version information and quit. (Short)
-version
Print version information and quit.- Print Arns.
$ awslogin -l
test- Login AWS management console.
$ awslogin -r test
(open browser)- Recommended usage.
Used with peco.
First install peco.
Next install awslogin.
Write to your ~/.zshrc file.
function al-src () {
local selected_arn=$(awslogin -l | peco --query "$LBUFFER")
BUFFER="awslogin -r ${selected_arn}"
zle accept-line
zle clear-screen
}
zle -N al-src
bindkey '+_' al-srcPress '+_', you can select arn.
- Configure AWS CLI [default profile]. http://docs.aws.amazon.com/streams/latest/dev/kinesis-tutorial-cli-installation.html#config-cli
- Configure using Assume role. http://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html
- If use to MFA, please set
mfa_serialparameter. - Install awslogin command
$ curl -sLO `curl -s 'http://grl.i-o.sh/youyo/awslogin?suffix=darwin_amd64.zip'`
$ unzip awslogin_darwin_amd64.zip- Fork (https://github.com/youyo/awslogin/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
go test ./...command and confirm that it passes - Run
gofmt -s - Create a new Pull Request