s/terraform/tofu, add tofu completion, check in zsh functions
This commit is contained in:
6
zsh/.local/share/zsh/functions/aws-ec2-instances
Normal file
6
zsh/.local/share/zsh/functions/aws-ec2-instances
Normal file
@@ -0,0 +1,6 @@
|
||||
aws-ec2-instances() {
|
||||
aws ec2 describe-instances --output json \
|
||||
| jq -r '.Reservations[].Instances[] |
|
||||
[.InstanceId, .State.Name, .PrivateIpAddress, (.PublicIpAddress // "N/A")] |
|
||||
@tsv'
|
||||
}
|
||||
10
zsh/.local/share/zsh/functions/aws-publish-ssh-key
Normal file
10
zsh/.local/share/zsh/functions/aws-publish-ssh-key
Normal file
@@ -0,0 +1,10 @@
|
||||
aws-publish-ssh-key() {
|
||||
local key_name="${1:-jswank-$(hostname)}"
|
||||
local key_file="${2:-$HOME/.ssh/id_ed25519.pub}"
|
||||
|
||||
[[ -f "$key_file" ]] || { echo "Key file not found: $key_file" >&2; return 1; }
|
||||
|
||||
aws ec2 import-key-pair \
|
||||
--key-name "$key_name" \
|
||||
--public-key-material "fileb://$key_file"
|
||||
}
|
||||
3
zsh/.local/share/zsh/functions/aws-set-prompt
Normal file
3
zsh/.local/share/zsh/functions/aws-set-prompt
Normal file
@@ -0,0 +1,3 @@
|
||||
aws-set-prompt() {
|
||||
export AWS_ENVIRONMENT=$(aws iam list-account-aliases | jq -r '.AccountAliases[0]')
|
||||
}
|
||||
Reference in New Issue
Block a user