Skip to content

Commit

Permalink
Merge pull request #36 from newscorp-ghfb/develop
Browse files Browse the repository at this point in the history
c7n-org - add ignore folders option for gcp
  • Loading branch information
kentnsw authored Mar 20, 2022
2 parents ec46ede + 598942a commit 0613da8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/c7n_org/scripts/gcpprojects.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
@click.option(
'-f', '--output', type=click.File('w'), default='-',
help="File to store the generated config (default stdout)")
def main(output):
@click.option('-i', '--ignore', multiple=True,
help="list of folders that won't be added to the config file")
def main(output, ignore):
"""
Generate a c7n-org gcp projects config file
"""
Expand All @@ -25,8 +27,12 @@ def main(output):
if project['lifecycleState'] != 'ACTIVE':
continue

if project["parent"]["id"] in ignore:
continue

project_info = {
'project_id': project['projectId'],
'project_number': project['projectNumber'],
'name': project['name'],
}

Expand Down

0 comments on commit 0613da8

Please sign in to comment.