mirror of
https://github.com/storytold/terraform-aws-observability-accelerator.git
synced 2026-10-09 00:09:43 +00:00
0b42935d8b
Skip cross account testing
26 lines
663 B
Python
26 lines
663 B
Python
import json
|
|
import glob
|
|
import re
|
|
|
|
|
|
def get_examples():
|
|
"""
|
|
Get all Terraform example root directories using their respective `versions.tf`;
|
|
returning a string formatted json array of the example directories minus those that are excluded
|
|
"""
|
|
exclude = {
|
|
'examples/eks-cross-account-with-central-amp', # Add examples here to exclude from terraform plan
|
|
}
|
|
|
|
projects = {
|
|
x.replace('/versions.tf', '')
|
|
for x in glob.glob('examples/**/versions.tf', recursive=True)
|
|
if not re.match(r'^.+/_', x)
|
|
}
|
|
|
|
print(json.dumps(list(projects.difference(exclude))))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
get_examples()
|