diff --git a/frontend/scripts/gather_aws_service_info.py b/frontend/scripts/gather_aws_service_info.py new file mode 100755 index 0000000..22adde5 --- /dev/null +++ b/frontend/scripts/gather_aws_service_info.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 +import boto3 +import json +import time + +orgs = boto3.client('organizations') +iam = boto3.client('iam') + +roots = orgs.list_roots() +root = roots['Roots'][0] +entity_path = root['Arn'].split('/', 1)[1] + +job = iam.generate_organizations_access_report(EntityPath=entity_path) +job_id = job['JobId'] + +params = { + 'JobId': job_id, +} + +services = [] + +while True: + report = iam.get_organizations_access_report(**params) + if report['JobStatus'] == 'IN_PROGRESS': + time.sleep(1) + elif report['JobStatus'] == 'COMPLETED': + for service in report['AccessDetails']: + services.append({ + 'name': service['ServiceName'], + 'namespace': service['ServiceNamespace'], + }) + + if report['IsTruncated']: + params['Marker'] = report['Marker'] + else: + break + else: + raise Exception(f"Unexpected job status: {report['JobStatus']}") + +print(json.dumps(services, indent=2)) diff --git a/frontend/src/app/(public-area)/articles/[slug]/page.tsx b/frontend/src/app/(public-area)/articles/[slug]/page.tsx index fc1fa1c..47ac85d 100644 --- a/frontend/src/app/(public-area)/articles/[slug]/page.tsx +++ b/frontend/src/app/(public-area)/articles/[slug]/page.tsx @@ -55,7 +55,12 @@ export default async function Page({ params }: Props) {