Update aws integration
This commit is contained in:
parent
c99cf97d63
commit
26c1c7d025
@ -13,12 +13,14 @@
|
||||
(add-hook 'vterm-mode-hook #'aws-local-profile)
|
||||
(add-hook 'term-mode-hook #'aws-local-profile)
|
||||
|
||||
(add-to-list 'aws-profiles "personal")
|
||||
(add-to-list 'aws-profiles "lola-cde")
|
||||
(add-to-list 'aws-profiles "lola-gbt")
|
||||
(defun aws-list-profiles ()
|
||||
(when (not (executable-find "aws"))
|
||||
(user-error "Unable to find executable \"aws\"!"))
|
||||
(let ((profile-string (shell-command-to-string "aws configure list-profiles")))
|
||||
(s-split "\n" profile-string)))
|
||||
|
||||
(defun aws-switch-profile (profile)
|
||||
(interactive (list (completing-read "Profile: " aws-profiles)))
|
||||
(interactive (list (completing-read "Profile: " (aws-list-profiles))))
|
||||
(setenv "AWS_PROFILE" profile)
|
||||
(when (eq major-mode 'vterm-mode)
|
||||
(vterm-send-C-e)
|
||||
@ -26,6 +28,10 @@
|
||||
(vterm-send-string (format "export AWS_PROFILE=%s\n" profile)))
|
||||
(setq aws-current-profile profile))
|
||||
|
||||
(defun aws-sso-login ()
|
||||
(interactive)
|
||||
(async-shell-command "AWS_PROFILE=default aws sso login"))
|
||||
|
||||
(add-hook 'emacs-startup-hook
|
||||
(lambda ()
|
||||
(aws-switch-profile "default")))
|
||||
|
Loading…
Reference in New Issue
Block a user