Merge branch 'master' of ssh://git.cyberstuff.me:222/T31M/dotfiles

This commit is contained in:
2021-11-19 15:47:51 +01:00
13 changed files with 22 additions and 39 deletions

View File

@ -1,4 +1,4 @@
# TWAICE AWS Credential Management for FiSH
# AWS Credential Management for FiSH
# TODO change your user
set AWS_IAM_USER ""
@ -24,19 +24,19 @@ function envAWS --description 'switch to different aws account environments (-)
switch $argv[1]
case dev
echo "switching to /refreshing dev"
aws-mfa --assume-role arn:aws:iam::$DEV_ACCOUNT_ID:role/Administrators --duration 43200 --role-session-name $AWS_IAM_USER
aws-mfa --assume-role arn:aws:iam::$DEV_ACCOUNT_ID:role/Administrator --duration 43200 --role-session-name $AWS_IAM_USER
getAWSenv
case stg
echo "switching to /refreshing staging"
aws-mfa --assume-role arn:aws:iam::$STG_ACCOUNT_ID:role/Administrators --duration 43200 --role-session-name $AWS_IAM_USER
aws-mfa --assume-role arn:aws:iam::$STG_ACCOUNT_ID:role/Administrator --duration 43200 --role-session-name $AWS_IAM_USER
getAWSenv
case prod
echo "switching to /refreshing prod"
aws-mfa --assume-role arn:aws:iam::$PROD_ACCOUNT_ID:role/Administrators --duration 3600 --role-session-name $AWS_IAM_USER
aws-mfa --assume-role arn:aws:iam::$PROD_ACCOUNT_ID:role/Administrator --duration 3600 --role-session-name $AWS_IAM_USER
getAWSenv
case ops
echo "switching to /refreshing ops"
aws-mfa --assume-role arn:aws:iam::$OPS_ACCOUNT_ID:role/Administrators --duration 3600 --role-session-name $AWS_IAM_USER
aws-mfa --assume-role arn:aws:iam::$OPS_ACCOUNT_ID:role/Administrator --duration 3600 --role-session-name $AWS_IAM_USER
getAWSenv
case '*'
echo "Wrong / Invalid Environment provided"

View File

@ -5,11 +5,6 @@ function ssm_tunnel --description 'access private AWS ressources via Bastion Hos
return
end
#if [ "$AWS_PROFILE" != "twaice-ops"* ]
# echo "Switch to OPS ENV first"
# return
#end
# Get bastion host ID using it's name
set INSTANCE_ID (aws ec2 describe-instances \
--filter 'Name=tag:Name,Values=ops-infrastructure-bastion'\

View File

@ -13,9 +13,9 @@ function t31m_prompt_right
end
end
printf '%s' \U231A
printf '%s' \U231A
printf (yellow)"("(off)(date +%H(yellow):(off)%M(yellow):(off)%S)(yellow)")"(off)
printf '%s' \U1F4C1
printf (yellow)"("(off)$cwd(yellow)")"(off)
printf (yellow)"("(off)$cwd(yellow)")"(off)
end