I want to trigger refreshs on a DataSet in QuickSight using a Lambda. Both QuickSight and Lambda are in the same account. When I tested it, I faced issues regarding permissions:
User: arn:aws:sts::<Account-Id>:assumed-role/<Lambda-Role-Name>/<Lambda-Name> is not authorized to perform: quicksight:CreateIngestion on resource: arn:aws:quicksight:us-east-1:<Account-Id>:dataset/<Data-Set-Id>/ingestion/<Operation-Id> because no identity-based policy allows the quicksight:CreateIngestion action (Service: AmazonQuickSight; Status Code: 403; Error Code: AccessDeniedException;
Then, I tried setting up permissions for the Lamba. I tried aws quicksight update-data-set-permissions
with following JSON:
{
"AwsAccountId": "<Account-Id>",
"DataSetId": "<Data-Set-Id>",
"GrantPermissions": [{
"Principal": "arn:aws:iam::<Account-Id>:role/<Lamba-Role-Name>",
"Actions": [
"quicksight:CreateIngestion"
]
}]
}
But I keep getting this error:
An error occurred (InvalidParameterValueException) when calling the UpdateDataSetPermissions operation: Invalid principal arn:aws:iam::<Account-Id>:role/<Lambda-Role-Name>; only QuickSight principals are supported at this point.
I tried registering this role as an user, but it also failed:
aws quicksight register-user --identity-type IAM --email email@amazon.com --user-role ADMIN --iam-arn arn:aws:iam::<Account-Id>:role/<Lambda-Role-Name> --aws-account-id <Account-Id> --namespace default
An error occurred (InvalidParameterValueException) when calling the RegisterUser operation: Invalid resource identifiers provided. Please check the documentation.
I was able to register the root user ( arn:aws:iam::<Account-Id>:root
) successfully. But it didn’t solve my problem.