Skip to content
This repository was archived by the owner on Nov 8, 2021. It is now read-only.

Commit d49c103

Browse files
grusymichaelwittig
authored andcommitted
fix tag enabled groups in multi account setup (#136)
1 parent 2aa0217 commit d49c103

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

iam_crossaccount_policy.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
"Resource": [
77
"arn:aws:iam::<YOUR_USERS_ACCOUNT_ID_HERE>:role/<YOUR_USERS_ACCOUNT_ROLE_NAME_HERE>"
88
]
9+
},{
10+
"Effect": "Allow",
11+
"Action": "ec2:DescribeTags",
12+
"Resource": "*"
913
}]
1014
}

import_users.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,6 @@ function sync_accounts() {
234234
# Check if local marker group exists, if not, create it
235235
/usr/bin/getent group "${LOCAL_MARKER_GROUP}" >/dev/null 2>&1 || /usr/sbin/groupadd "${LOCAL_MARKER_GROUP}"
236236

237-
# setup the aws credentials if needed
238-
setup_aws_credentials
239-
240237
# declare and set some variables
241238
local iam_users
242239
local sudo_users
@@ -249,6 +246,9 @@ function sync_accounts() {
249246
get_iam_groups_from_tag
250247
get_sudoers_groups_from_tag
251248

249+
# setup the aws credentials if needed
250+
setup_aws_credentials
251+
252252
iam_users=$(get_clean_iam_users | sort | uniq)
253253
if [[ -z "${iam_users}" ]]
254254
then

0 commit comments

Comments
 (0)