Commit 9c6eeede authored by nimrod's avatar nimrod
Browse files

Some SchooLinks updates I accumulated.

parent 7af6ac91
Loading
Loading
Loading
Loading
+6
Changes for .aws/config.j2: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -20,6 +20,12 @@ sso_session = schoolinks
sso_account_id = {{ run(["ph", "show", "--field", "Account ID", "SchooLinks/AWS SSO"])["stdout"] }}
sso_role_name = TerraformDeployersAccess

[profile schoolinks-prod-oncall]
region = us-east-1
sso_session = schoolinks
sso_account_id = {{ run(["ph", "show", "--field", "Account ID", "SchooLinks/AWS SSO"])["stdout"] }}
sso_role_name = OncallParticipants

[profile schoolinks-dev]
region = us-east-1
sso_session = schoolinks
+17
Changes for .bash_completion.d/sla: 17 added lines, 0 removed lines.
Original line number Diff line number Diff line
# vim: ft=bash

_sla() {
    local cur prev words cword opts
    _init_completion || return
    opts='-h --help -l --list -d --dry-update -u --update -k --kill -s --kill-server -i --in-workbench -r --rm --remove'
    opts="-l -h"

    if [[ $cur == -* ]]
    then
        COMPREPLY=($(compgen -W "$opts" -- "$cur"))
    else
        COMPREPLY=($(compgen -W "$(sla -l)" -- "$cur"))
    fi
}

complete -F _sla sla
+35
Changes for .bashrc.d/schoolinks: 35 added lines, 0 removed lines.
Original line number Diff line number Diff line
# shellcheck shell=bash
# vim: ft=sh

alias sl-cf='curl --fail --proto "=https" --show-error --header "X-Auth-Email: ${CLOUDFLARE_EMAIL}" --header "X-Auth-Key: ${CLOUDFLARE_API_KEY}"'

sla () {
    local profiles="$(aws configure list-profiles | sed -n 's/^schoolinks-//p')"
    local usage="sla [-h] [-l] profile"
    local f
    while getopts lh f
    do
        case "$f" in
            l) echo "$profiles"; return 0;;
            h) echo "$usage"; return 0;;
            \?) echo "$usage"; return 1;;
        esac
    done
    shift $((OPTIND - 1))
    if [ "$#" -ne 1 ]
    then
        echo "$usage"; return 1;
    fi
    local profile="$1"
    if ! echo "$profiles" | grep --quiet --fixed-strings --line-regexp "$profile"
    then
        echo "Unknown profile ${profile}. Possible profiles: $(echo $profiles | tr '\n' ', ')."
        return 1
    fi
    export AWS_PROFILE="schoolinks-${profile}"
    export AWS_DEFAULT_PROFILE="schoolinks-${profile}"
    if ! aws sts get-caller-identity --query "Account" >/dev/null 2>/dev/null
    then
        aws sso login
    fi
}
+2 −2
Changes for .ssh/config.d/20_schoolinks: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -8,10 +8,10 @@ Host sftp*.schoolinks.com
Host firezone*.schoolinks.com
    IdentityFile ~/Repositories/SchooLinks/sl-devops/secrets/vpn

Host !firezone.schoolinks.com *.schoolinks.com 172.31.*.* 172.30.*.* 172.29.*.*
Host !firezone.schoolinks.com *.schoolinks.com 172.31.*.* 172.30.*.* 172.29.*.* 172.28.*.* 172.27.*.*
    ProxyCommand ssh firezone.schoolinks.com -W %h:%p

Host *.schoolinks.com 172.31.*.* 172.30.*.* 172.29.*.*
Host *.schoolinks.com 172.31.*.* 172.30.*.* 172.29.*.* 172.28.*.* 172.27.*.*
    User ubuntu
    IdentityFile ~/.ssh/schoolinks_ed25519
    IdentityFile ~/.ssh/schoolinks_rsa
+6 −2
Changes for Repositories/SchooLinks/.envrc: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -4,13 +4,17 @@ if ( cd .. && find_up .envrc >/dev/null )
then
    source_up || true
fi
export AWS_DEFAULT_PROFILE=schoolinks
export AWS_PROFILE=schoolinks

export ATLASSIAN_OPS_API_EMAIL_ADDRESS='nimrod@schoolinks.com'
export AWS_PROFILE=schoolinks-dev-admin
export CLOUDSDK_ACTIVE_CONFIG_NAME=schoolinks
export COMPOSE_FILE='docker-compose.local.yml'
export GIT_AUTHOR_EMAIL='nimrod@schoolinks.com'
export GIT_AUTHOR_NAME='Nimrod Adar'
export HUSKY=0
export KUBECONFIG="${HOME}/Repositories/SchooLinks/.kubeconfig"
PATH="$PATH:$(dirname "$(command -v python3)")/../installs/python/$(python3 --version | awk '{print $2}')/bin"
export PATH
export PIPENV_VENV_IN_PROJECT=1
export JIRA_USERNAME=nimrod@schoolinks.com
source_env_if_exists .envrc.private
Loading