Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mbailey committed Oct 30, 2019
1 parent 3c03c89 commit 36c3cf3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions aliases
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ alias asg-stack='~/.bash-my-aws/bin/bma asg-stack'
alias asg-suspend='~/.bash-my-aws/bin/bma asg-suspend'
alias asgs='~/.bash-my-aws/bin/bma asgs'
alias aws-account-alias='~/.bash-my-aws/bin/bma aws-account-alias'
alias aws-account-each='~/.bash-my-aws/bin/bma aws-account-each'
alias aws-account-id='~/.bash-my-aws/bin/bma aws-account-id'
alias aws-panopticon='~/.bash-my-aws/bin/bma aws-panopticon'
alias bucket-acls='~/.bash-my-aws/bin/bma bucket-acls'
Expand Down
9 changes: 7 additions & 2 deletions lib/misc-functions
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ aws-account-id() {
aws sts get-caller-identity --query Account --output text
}

# aws-panopticon - Run command on multiple AWS Accounts
# aws-account-each - Run command on multiple AWS Accounts
#
# Reads AWS Account IDs from STDIN
# Assumes an IAM Role on each account and runs command given as arguments
#
aws-panopticon() {
aws-account-each() {
local aws_account_ids="$(__bma_read_inputs)"
local cmd=$@
local assumed_role_name="${AWS_PANOPTICON_ROLE_NAME:-SecurityAuditor}"
Expand All @@ -40,6 +40,11 @@ aws-panopticon() {
done
}

# aws-panopticon was previous name for aws-account-each()
aws-panopticon() {
aws-account-each $@
}

# columnise(): Handy function to columnise output
#
# Leaving the command itself in functions (for now) to be explicit but
Expand Down

0 comments on commit 36c3cf3

Please sign in to comment.