Migration-scripts/cdk/lambda/quicksight_migration/quicksight_migration/batch_migration_lambda.py [532:623]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                    break
            if missing:
                break
        if missing:
            continue

        source_entity = {
            'SourceTemplate': {
                'DataSetReferences': dsref,
                'Arn': template['Arn']
            }
        }

        dashboard = qs_utils.describe_dashboard(targetsession, source_dash_id)

        if 'Faild to describe dashboard:' in dashboard:
            if 'dashboard/'+source_dash_id+' is not found' in dashboard:
                logger.info("Create new dashboard: %s", source_dash_name)
                try:
                    newdashboard = qs_utils.create_dashboard(
                        targetsession, source_dash_id, source_dash_name,
                        targetadmin, source_entity, '1', target_theme_arn, filter='ENABLED',
                        csv='ENABLED', sheetcontrol='COLLAPSED'
                    )
                except Exception as ex:
                    qs_utils.delete_template(targetsession, source_dash_id)
                    dashboard_failed.append(
                        {
                            "Error Type": "Create New Dashboard Error",
                            "DashboardId": source_dash_id,
                            "Name": source_dash_name,
                            "Error": str(ex)
                        }
                    )
                    continue
            else:
                dashboard_failed.append(
                    {
                        "Error Type": "Describe Target Dashboard Error",
                        "DashboardId": source_dash_id,
                        "Name": source_dash_name,
                        "Error": str(dashboard)
                    }
                )
                continue
        elif dashboard['Dashboard']['Version']['Status'] == "CREATION_FAILED":
            res = qs_utils.delete_dashboard(targetsession, source_dash_id)
            try:
                newdashboard = qs_utils.create_dashboard(
                    targetsession, source_dash_id, source_dash_name,
                    targetadmin, source_entity, '1', target_theme_arn, filter='ENABLED',
                    csv='ENABLED', sheetcontrol='COLLAPSED'
                )
            except Exception as ex:
                qs_utils.delete_template(targetsession, source_dash_id)
                dashboard_failed.append(
                    {
                        "Error Type": "Create Dashboard Error",
                        "DashboardId": source_dash_id,
                        "Name": source_dash_name,
                        "Error": str(ex)
                    }
                )
                continue

        else:
            logger.info("Dashboard already exists, recreating instead: %s", source_dash_name)
            try:
                res = qs_utils.delete_dashboard(targetsession, source_dash_id)
                newdashboard = qs_utils.create_dashboard(
                    targetsession, source_dash_id, source_dash_name,
                    targetadmin, source_entity, '1', target_theme_arn, filter='ENABLED',
                    csv='ENABLED', sheetcontrol='COLLAPSED'
                )
                # newdashboard = qs_utils.update_dashboard(
                #     targetsession, source_dash_id, source_dash_name,
                #     source_entity, target['version'], filter='ENABLED',
                #     csv='ENABLED', sheetcontrol='EXPANDED'
                # )
            except Exception as ex:
                qs_utils.delete_template(targetsession, source_dash_id)
                dashboard_failed.append(
                    {
                        "Error Type": "Update Dashboard Error",
                        "DashboardId": source_dash_id,
                        "Name": source_dash_name,
                        "Error": str(ex)
                    }
                )
                continue

        res = qs_utils.describe_dashboard(targetsession, newdashboard['DashboardId'])
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



Migration-scripts/cdk/lambda/quicksight_migration/quicksight_migration/incremental_migration_lambda.py [650:741]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                break
            if missing:
                break
        if missing:
            continue

        source_entity = {
            'SourceTemplate': {
                'DataSetReferences': dsref,
                'Arn': template['Arn']
            }
        }

        dashboard = qs_utils.describe_dashboard(targetsession, source_dash_id)

        if 'Faild to describe dashboard:' in dashboard:
            if 'dashboard/'+source_dash_id+' is not found' in dashboard:
                logger.info("Create new dashboard: %s", source_dash_name)
                try:
                    newdashboard = qs_utils.create_dashboard(
                        targetsession, source_dash_id, source_dash_name,
                        targetadmin, source_entity, '1', target_theme_arn, filter='ENABLED',
                        csv='ENABLED', sheetcontrol='COLLAPSED'
                    )
                except Exception as ex:
                    qs_utils.delete_template(targetsession, source_dash_id)
                    dashboard_failed.append(
                        {
                            "Error Type": "Create New Dashboard Error",
                            "DashboardId": source_dash_id,
                            "Name": source_dash_name,
                            "Error": str(ex)
                        }
                    )
                    continue
            else:
                dashboard_failed.append(
                    {
                        "Error Type": "Describe Target Dashboard Error",
                        "DashboardId": source_dash_id,
                        "Name": source_dash_name,
                        "Error": str(dashboard)
                    }
                )
                continue
        elif dashboard['Dashboard']['Version']['Status'] == "CREATION_FAILED":
            res = qs_utils.delete_dashboard(targetsession, source_dash_id)
            try:
                newdashboard = qs_utils.create_dashboard(
                    targetsession, source_dash_id, source_dash_name,
                    targetadmin, source_entity, '1', target_theme_arn, filter='ENABLED',
                    csv='ENABLED', sheetcontrol='COLLAPSED'
                )
            except Exception as ex:
                qs_utils.delete_template(targetsession, source_dash_id)
                dashboard_failed.append(
                    {
                        "Error Type": "Create Dashboard Error",
                        "DashboardId": source_dash_id,
                        "Name": source_dash_name,
                        "Error": str(ex)
                    }
                )
                continue

        else:
            logger.info("Dashboard already exists, recreating instead: %s", source_dash_name)
            try:
                res = qs_utils.delete_dashboard(targetsession, source_dash_id)
                newdashboard = qs_utils.create_dashboard(
                    targetsession, source_dash_id, source_dash_name,
                    targetadmin, source_entity, '1', target_theme_arn, filter='ENABLED',
                    csv='ENABLED', sheetcontrol='COLLAPSED'
                )
                # newdashboard = qs_utils.update_dashboard(
                #     targetsession, source_dash_id, source_dash_name,
                #     source_entity, target['version'], filter='ENABLED',
                #     csv='ENABLED', sheetcontrol='EXPANDED'
                # )
            except Exception as ex:
                qs_utils.delete_template(targetsession, source_dash_id)
                dashboard_failed.append(
                    {
                        "Error Type": "Update Dashboard Error",
                        "DashboardId": source_dash_id,
                        "Name": source_dash_name,
                        "Error": str(ex)
                    }
                )
                continue

        res = qs_utils.describe_dashboard(targetsession, newdashboard['DashboardId'])
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



