From eff7e0fe5b7ab96ea4734ceb82b8ed161cc76f98 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Sun, 13 Dec 2020 08:40:06 -0500 Subject: [PATCH] Add function to switch AWS profiles --- emacs/.emacs.d/init.org | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 563178b..29e76d8 100755 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -5364,6 +5364,23 @@ Syntax highlighting for Dockerfiles: #+END_SRC * AWS +** Switching profiles +Switch AWS profiles: +#+BEGIN_SRC emacs-lisp + (defvar aws-profiles '("default") + "AWS profile names") + (defvar aws-current-profile nil + "Currently active AWS profile") + + (setq aws-current-profile (getenv "AWS_PROFILE")) + (add-to-list 'aws-profiles "personal") + + (defun aws-switch-profile (profile) + (interactive (list (completing-read "Profile: " aws-profiles))) + (setenv "AWS_PROFILE" profile) + (setq aws-current-profile profile)) +#+END_SRC + ** S3 #+BEGIN_SRC emacs-lisp (use-package s3ed