I have deployed a Lambda function to VPC. The function will be used for exporting quicksight dashboard asset bundles on daily basis and storing them in an S3 bucket for backup purposes. The quicksight account has access to athena workgroup and s3 buckets, but it is not running in VPC.
First, I need to fetch the list of available dashboards for using each dashboard’s name in backup files. For this purpose, I have added the following permission policies to the lambda execution role, but getting timeout error while trying to list the assets:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor2",
"Effect": "Allow",
"Action": [
"quicksight:ListDashboards",
"quicksight:ListAnalyses"
],
"Resource": "*"
}
]
}
Code snippet from my lambda function looks like:
import boto3
quicksight_client = boto3.client(
service_name='quicksight',
region_name="ap-northeast-1"
)
def list_quicksight_dashboards():
# Get the list of dashboards
response = quicksight_client.list_dashboards(
AwsAccountId='001122334455'
)
# Print the list of dashboards
dashboards = response.get('DashboardSummaryList', [])
for dashboard in dashboards:
print(f"Dashboard ID: {dashboard['DashboardId']}, Name: {dashboard['Name']}")
def lambda_handler(event, context):
list_quicksight_dashboards()
return {
'statusCode': 200,
'body': json.dumps('OK')
}
I have already tried to follow this solution: Adding permissions for Lambda access - JSON - Question & Answer - Amazon QuickSight Community
Is there anythink that I probably may have missed during configuration of the lambda function?