- Newest
- Most votes
- Most comments
Cross-Account Access to Timestream via Athena Federated Queries
I managed to do this using the following approach:
In Account A (where Timestream resides):
-
Set up Lambda connector to Timestream
- Navigate to:
Lambda → Applications → AthenaTimestreamConnector - Make sure to check the box to visualize the connector:
"Show apps that create custom IAM roles or resource policies"
- Navigate to:
-
Add the connector to Athena
- Go to Athena Data Sources
- Choose
Connect data source → custom or shared connector → select the deployed Lambda
In Account B (consumer account):
-
Use Athena Federated Queries
-
Follow AWS doc: Cross-Account Federated Queries in Athena
Set up permissions & trust relationships
-
Configure trust policy between accounts
-
Set up appropriate IAM policies and Lambda resource policies in account A
-
Ensure S3 bucket policy allows access from account B
-
-
Update QuickSight permissions
- Add permissions to the QuickSight role in Account B to:
- Access the S3 bucket in Account A
- Invoke the Lambda in Account A
- Add permissions to the QuickSight role in Account B to:
Final Step in Account A:
- In the Athena console, share the Lambda connector with Account B
You should now be able to see and query the data from the Timestream in Account A from Account B using Athena and adding it to Quicksight.
To set up cross-account access for Amazon Timestream data in QuickSight, you need to follow a specific process:
First, ensure that QuickSight in Account B is authorized to connect to Amazon Timestream. A QuickSight administrator needs to:
- Open the menu by clicking on the profile icon at the top right
- Choose "Manage QuickSight"
- Select "Security & permissions"
- Click "Add or remove"
- Enable the checkbox for Amazon Timestream
- Choose "Update" to confirm
For your cross-account setup, your approach with IAM roles is on the right track, but requires some adjustments:
In Account A (where Timestream is located):
- Your trust policy should allow QuickSight from Account B to assume the role
- The permissions policy looks good with the necessary Timestream permissions
In Account B (where QuickSight is located):
- QuickSight needs permission to assume the role in Account A
- This is typically handled through the QuickSight service role
One key element you might be missing is that after setting up the IAM roles correctly, you need to:
- Go to QuickSight in Account B
- Create a new dataset
- Select Timestream as the data source
- When configuring the connection, you'll need to specify the role ARN from Account A that QuickSight should assume
If you're not seeing cross-account options in the QuickSight interface, it could be because:
- You might not have administrator privileges in QuickSight
- The QuickSight edition you're using might not support this feature
- The IAM permissions for your QuickSight service role might need additional configuration
Try reviewing your QuickSight service role permissions in Account B to ensure it has the necessary permissions to assume roles in other accounts.
Sources
Using Amazon Timestream data with Amazon QuickSight - Amazon QuickSight
TimeStream Cross account | AWS re:Post
Cross account access to QuickSight (password-less way) | AWS re:Post
How to access resources in a multi account setup for a Managed Grafana Workspace | AWS re:Post
Amazon QuickSight - Amazon Timestream
