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 - add ignore folders option for gcp #36

Merged
merged 1 commit into from
Mar 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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