Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c7n-org orgaccounts.py add flag to ignore specific OU's #6958

Open
myoung34 opened this issue Oct 25, 2021 · 0 comments
Open

c7n-org orgaccounts.py add flag to ignore specific OU's #6958

myoung34 opened this issue Oct 25, 2021 · 0 comments

Comments

@myoung34
Copy link
Contributor

myoung34 commented Oct 25, 2021

Describe the feature

Theres a flag in orgaccounts.py to include an OU, but we have multiple

I would like to exclude an OU and not explicitly list all of them to include.

Extra information or context

my current hack:

flags=$(for i in $(aws organizations list-children --parent-id r-trwk --child-type ORGANIZATIONAL_UNIT | jq -r '.Children[].Id'); do   org_id=$(aws organizations describe-organizational-unit --organizational-      unit-id $i | jq -r '.OrganizationalUnit | select(.Name == "someOUtoIgnore") | .Id');   if [[ -n ${org_id} ]]; then     aws organizations list-children --parent-id ${org_id} --child-type ACCOUNT | jq -r .Children[].Id;   fi; done | sed 's/^/ -i /g' | tr -d '\n')

python3 /orgaccounts.py --role "arn:aws:iam::{Id}:role/cloud-custodian" -f accounts.yml -a ${flags}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants