mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
6afcf161db
* Added initial code for guard duty, tested some of it * Add finished (*) guard duty code * Removed temp workaround stuff
17 lines
604 B
Bash
Executable File
17 lines
604 B
Bash
Executable File
#!/bin/bash
|
|
#last_account=492052055440
|
|
#start='false'
|
|
for account_id in $(aws organizations list-accounts | jq -r '.Accounts[] | .Id' | grep -v '831217569274' | grep -v '353365949058'); do
|
|
#if [[ ${last_account} == ${account_id} ]]; then
|
|
# start='true'
|
|
#fi
|
|
#if [[ $start == 'false' ]]; then
|
|
# continue
|
|
#fi
|
|
for region in $(aws ec2 describe-regions | jq -r '.Regions[] | .RegionName'); do
|
|
terraform workspace new "$account_id:$region"
|
|
terraform workspace select "$account_id:$region" || exit 1
|
|
terraform apply -auto-approve || exit 1
|
|
done
|
|
done
|