Guest User

Untitled

a guest
Jul 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #!/bin/bash -xe
  2. role_name=$1
  3.  
  4. [[ $# < 1 ]] && echo "$0 <role_name>" && exit 1
  5. account_id=$(aws sts get-caller-identity | jq -r '.Account')
  6. role_name=arn:aws:iam::$account_id:role/$role_name
  7. kubectl run --image=fstab/aws-cli --overrides=$(\
  8. jo spec=$(\
  9. jo template=$(\
  10. jo metadata=$(jo annotations=$(\jo iam.amazonaws.com/role=$role_name))
  11. ))) \
  12. aws-cli \
  13. --rm -it \
  14. --command -- /bin/bash
Add Comment
Please, Sign In to add comment