Python script errors after launching the 1st cloudformation template from the notebook

Object_access.csv not generated with this error and cannot modify script in s3://admin-console-cfn-dataprepare-code/glue/scripts/2025/
Trying to debug by editing the script but it does not seem like we can modify
Please advise as we try to use this demo for a POC

2025-05-27T09:55:06.964-07:00
raise e_type(e_value).with_traceback(new_stack)
File “/tmp/glue-python-scripts-m24e/adminconsoleuserdataaccessinfo.py”, line 545, in
raise e_type(e_value).with_traceback(new_stack) File “/tmp/glue-python-scripts-m24e/adminconsoleuserdataaccessinfo.py”, line 545, in

2025-05-27T09:55:06.964-07:00
KeyError: KeyError(‘Name’)

I have clone the code and make the changes below by adding the try and except block to work around the error and generated the object_access.csv
for analysis in analyses:
if analysis[‘Status’] != ‘DELETED’:
analysisid = analysis[‘AnalysisId’]

        try:
            response = describe_analysis_permissions(account_id, analysisid, glue_aws_region)
            permissions = response['Permissions']
            for principal in permissions:
                actions = '|'.join(principal['Actions'])
                arn = principal['Principal']
                principal = principal['Principal'].split("/")
                ptype = principal[0].split(":")
                ptype = ptype[-1]
                additional_info = principal[-2]
                if len(principal)==4:
                    principal = principal[2]+'/'+principal[3]
                elif len(principal)==3:
                    principal = principal[2]
                else:
                    principal = principal[1]
                #print(analysis['Name'])
                access.append(
                    [account_id, glue_aws_region, 'analysis', analysis['Name'], analysisid, ptype, principal, arn, additional_info, actions])
        except Exception as e:
            print(e)
1 Like

Hello @mariafung, my apologies for the late response! Did that work-around resolve the issue you were facing? I couldn’t fully see what the issue was from the initial post. So if you still need assistance, could you provide a little more background on the error you are running into? Alternatively, if your last message resolved the problem, feel free to mark it as the solution! Thank you!

This error is coming from after the launch of the 1st cloudformation template for the adminconcole2025. The code in adminconsoleuserdataaccessinfo.py will require a try and except block to catch the error otherwise object_access.csv will not be able to generate

1 Like