This commit is contained in:
Marcus Noble 2020-11-25 17:25:11 +00:00
commit f7e3bf6af9
4 changed files with 48 additions and 6 deletions

View File

@ -1,10 +1,29 @@
prompt_order=["directory","git_branch","git_commit","git_state","git_status","package","golang","nodejs","terraform","memory_usage","aws","kubernetes","cmd_duration","custom","line_break","jobs","battery","time","character"] format = """\
$directory\
$git_branch\
$git_commit\
$git_state\
$git_status\
$package\
$golang\
$nodejs\
$terraform\
$memory_usage\
$aws\
$kubernetes\
$cmd_duration\
$custom\
$line_break\
$jobs\
$battery\
$time\
$character\
"""
[character] [character]
symbol = "✨ " success_symbol = "[✨](yellow)"
error_symbol = "✗ " error_symbol = "[✗](red)"
use_symbol_for_status = true use_symbol_for_status = true
style_success = "yellow"
[aws] [aws]
symbol = " " symbol = " "

View File

@ -14,5 +14,4 @@ lt() {
fi fi
ls -l --tree -L $DEPTH -I ".git|cache|log|logs|node_modules|vendor" $@ ls -l --tree -L $DEPTH -I ".git|cache|log|logs|node_modules|vendor" $@
} }
alias aws='docker run --rm -ti -v ~/.aws:/root/.aws -v $(pwd):/aws -e AWS_PROFILE -e AWS_DEFAULT_REGION -e AWS_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY amazon/aws-cli' alias aws='docker run --rm -ti -v ~/.aws:/root/.aws -v $(pwd):/aws -e AWS_PROFILE -e AWS_DEFAULT_REGION -e AWS_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY amazon/aws-cli'

24
.dotfiles/aws Normal file
View File

@ -0,0 +1,24 @@
alias aws='docker pull -q amazon/aws-cli:latest 1> /dev/null && docker run --rm -i -v ~/.aws:/root/.aws -v $(pwd):/aws -e NO_COLOR=true -e AWS_PROFILE -e AWS_DEFAULT_REGION -e AWS_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN amazon/aws-cli'
assume-role() {
ROLE=$1
if [[ -z "$ROLE" ]]; then
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export AWS_SESSION_TOKEN=
else
OUTPUT=$(aws sts assume-role --role-arn $ROLE --role-session-name assumed-role-session --query Credentials --output json)
export AWS_ACCESS_KEY_ID=$(echo $OUTPUT | jq -r .AccessKeyId)
export AWS_SECRET_ACCESS_KEY=$(echo $OUTPUT | jq -r .SecretAccessKey)
export AWS_SESSION_TOKEN=$(echo $OUTPUT | jq -r .SessionToken)
fi
aws sts get-caller-identity
}
aws-decode-message() {
ENCODED=$1
aws sts decode-authorization-message --query DecodedMessage --output text --encoded-message $ENCODED | jq -r '.context.action, .context.resource'
}

View File

@ -10,7 +10,7 @@ pre-reqs: ## Install all required binaries.
brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null || brew install homebrew/cask-fonts/font-open-dyslexic-nerd-font; \ brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null || brew install homebrew/cask-fonts/font-open-dyslexic-nerd-font; \
which fzf > /dev/null || brew install fzf; \ which fzf > /dev/null || brew install fzf; \
which bat > /dev/null || brew install bat; \ which bat > /dev/null || brew install bat; \
which curlie > /dev/null | brew install rs/tap/curlie; \ which curlie > /dev/null || brew install rs/tap/curlie; \
which exa > /dev/null || brew install exa; \ which exa > /dev/null || brew install exa; \
which kubectl > /dev/null || brew install kubectl; \ which kubectl > /dev/null || brew install kubectl; \
which tkn > /dev/null || brew install tektoncd/tools/tektoncd-cli; \ which tkn > /dev/null || brew install tektoncd/tools/tektoncd-cli; \