# Lambda timing out when calling Quick Sight APIs for dashboards, datasets, datasources, analyses, and theme

**URL:** <https://community.amazonquick.com/t/lambda-timing-out-when-calling-quicksight-apis-for-dashboards-datasets-datasources-analyses-and-theme/32447>\
**Category:** Q&A\
**Tags:** admin, quick-sight\
**Created:** [July 10, 2024, 6:29pm UTC](https://community.amazonquick.com/t/lambda-timing-out-when-calling-quicksight-apis-for-dashboards-datasets-datasources-analyses-and-theme/32447 "2024-07-10T18:29:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cecardev](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@cecardev](https://community.amazonquick.com/u/cecardev)\
**Post date:** [July 10, 2024, 6:29pm UTC](https://community.amazonquick.com/t/lambda-timing-out-when-calling-quicksight-apis-for-dashboards-datasets-datasources-analyses-and-theme/32447/1 "2024-07-10T18:29:10Z")

</div>

I am following this blog post on building an admin console on Quick Sight to analyze and visualize Quick Sight metrics. [Building an administrative console in Amazon QuickSight to analyze usage metrics | AWS Big Data Blog](https://aws.amazon.com/blogs/big-data/building-an-administrative-console-in-amazon-quicksight-to-analyze-usage-metrics/)

The AWS Lambda function “Data\_Prepare” is scheduled to run hourly. This function calls Quick Sight APIs to get Quick Sight namespace, group, user, and assets access permissions information and saves the results to an Amazon S3 bucket. The Lambda stores this information into two different csv files that will then be stored in S3.

In order to access the data for dashboards, the function calls the API `list_dashboards` and goes into a for loop where for each dashboard, the API `describe_dashboard_permissions` is called and the necessary information is appended to a list. The same process is done for datasets, datasources, analyses, and themes, by calling `list_datasets`, `list_datasources`, `list_analyses`, `list_themes`, `describe_data_set_permissions`, `describe_data_source_permissions`, `describe_analysis_permissions`, and `describe_theme_permissions`.

Given the growth of the data that the Lambda is handling, and the long process of looping through each of these objects, the Lambda times out at 15 minutes, the maximum timeout for a Lambda function.

I am wondering if anyone else has ran into an issue of a Lambda timing out when doing Quick Sight API calls or if there are other APIs that can give me the necessary information without having to loop and call for each object’s information.

---

<div class="post-metadata">

**Author:** ![Thomas](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/thomas/32/3624_2.png) [@Thomas](https://community.amazonquick.com/u/Thomas)\
**Post date:** [July 11, 2024, 11:38am UTC](https://community.amazonquick.com/t/lambda-timing-out-when-calling-quicksight-apis-for-dashboards-datasets-datasources-analyses-and-theme/32447/2 "2024-07-11T11:38:35Z")

</div>

Hi @cecardev,  
Welcome to the community!

To get all the necessary information, the combination of listing the various asset types and getting details for each asset via the respective `describe` API is required. To avoid running into the timeout, you could either split the Lambda function up into multiple Lambda functions and chain them (e.g. using [Workflow Orchestration - AWS Step Functions - AWS](https://aws.amazon.com/step-functions/)) or, if the runtime would still meet your own requirements, run the code as is within a container on a compute option of your choice (e.g. [AWS Fargate](https://aws.amazon.com/fargate), [EC2 instances](https://aws.amazon.com/ec2/), etc.).

Did this answer your question? If so, please help the community out by marking this answer as "Solution!

---

<div class="post-metadata">

**Author:** ![Xclipse](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/xclipse/32/20455_2.png) [@Xclipse](https://community.amazonquick.com/u/Xclipse)\
**Post date:** [July 15, 2024, 3:11pm UTC](https://community.amazonquick.com/t/lambda-timing-out-when-calling-quicksight-apis-for-dashboards-datasets-datasources-analyses-and-theme/32447/3 "2024-07-15T15:11:53Z")

</div>

Hi @cecardev, did this solution work for you? I am marking this reply as, “Solution,” but let us know if this is not resolved. Thanks for posting your questions on the Quick Sight Community!

---

<div class="post-metadata">

**Author:** ![nasa](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@nasa](https://community.amazonquick.com/u/nasa)\
**Post date:** [February 25, 2025, 11:11am UTC](https://community.amazonquick.com/t/lambda-timing-out-when-calling-quicksight-apis-for-dashboards-datasets-datasources-analyses-and-theme/32447/4 "2025-02-25T11:11:13Z")

</div>

Hello @cecardev

My lambda function is facing the same timeout issue. The function is running in a VPC and cant access the Quicksight.

How have you configured the VPC, Subnets and Security Group of your lambda function?
