Compare commits

..

No commits in common. "bb7f28b9fbdbd888470583816934d578b859f218" and "95f233771ad0fca8963ceaa8dfccb78913a01295" have entirely different histories.

6 changed files with 4 additions and 43 deletions

View File

@ -1 +0,0 @@
autocmd BufNewFile,BufRead *.tofu setlocal filetype=terraform

View File

@ -1,12 +1,6 @@
aws-ec2-instances() { aws-ec2-instances() {
aws ec2 describe-instances --output json \ aws ec2 describe-instances --output json \
| jq -r '.Reservations[].Instances[] | | jq -r '.Reservations[].Instances[] |
[ [.InstanceId, .State.Name, .PrivateIpAddress, (.PublicIpAddress // "N/A")] |
.InstanceId,
.State.Name,
.PrivateIpAddress,
(.PublicIpAddress // "N/A"),
((.Tags | map("\(.Key)=\(.Value)") | join(", ")) // "N/A")
] |
@tsv' @tsv'
} }

View File

@ -1,25 +0,0 @@
aws-get-secret () {
local secret_id="${1}"
if [[ -z "$secret_id" ]]; then
secret_id=$(aws secretsmanager list-secrets \
| jq -r '.SecretList | sort_by(.Name) | .[] | [.Name,.LastChangedDate] | @tsv' \
| awk -F'\t' '{
full_name = $1;
truncated_name = substr($1,1,30);
split($2, date_parts, "T");
# Output: full_name (for return), truncated_name (for display), date (for display)
printf "%s\t%-30s\t%s\n", full_name, truncated_name, date_parts[1]
}' \
| fzf \
--header="$(printf '%-30s\t%s\n' 'NAME' 'LAST_CHANGED_DATE')" \
--delimiter='\t' \
--with-nth=2,3 \
| awk '{print $1}') \
[[ -z "$secret_id" ]] && return 1
fi
echo "Retrieving secret: $secret_id" >&2
aws secretsmanager get-secret-value --secret-id "$secret_id" --query SecretString --output text
}

View File

@ -1,3 +0,0 @@
aws-list-secrets() {
aws secretsmanager list-secrets | jq -r '.SecretList[] | [.Name,.LastChangedDate,.ARN] | @tsv'
}

View File

@ -4,8 +4,8 @@ aws-ssm-connect() {
--filters "Name=instance-state-name,Values=running" \ --filters "Name=instance-state-name,Values=running" \
--query 'Reservations[].Instances[].[InstanceId,Tags[?Key==`Name`].Value|[0],PrivateIpAddress,InstanceType]' \ --query 'Reservations[].Instances[].[InstanceId,Tags[?Key==`Name`].Value|[0],PrivateIpAddress,InstanceType]' \
--output text \ --output text \
| awk '{printf "%-20s %-40s %-15s %s\n", $1, substr($2, 1, 40), $3, $4}' \ | awk '{printf "%-20s %-40s %-15s %s\n", $1, $2, $3, $4}' \
| fzf --header="$(printf '%-20s %-40s %-15s %s' 'Instance ID' 'Name' 'IP' 'Type')" \ | fzf --header="Instance ID Name IP Type" \
| awk '{print $1}') | awk '{print $1}')
[[ -z "$instance_id" ]] && return 1 [[ -z "$instance_id" ]] && return 1

View File

@ -1,4 +0,0 @@
spacelift-login() {
spacectl profile login && export SPACELIFT_API_TOKEN=$(spacectl profile export-token)
export SPACECTL_SKIP_STACK_PROMPT=true
}