Quicksight Cognito lambda configured to display Quicksight Dashboard inside web application without Amplify black magic.
Technologies: API Gateway V2, S3 bucket, Quicksight, Cognito, IAM, CloudFront, CloudWatch, CloudFormation, Javascript Lambda, React webApp with Amplify library
Lambda dependencies: AWS SDK v3, @vendia/serverless-express, Babel + Webpack
WebApp dependencies: React, @aws-amplify/ui-react, amazon-quicksight-embedding-sdk
- Create a Quicksight Enterprise account (this cannot be created by Cloudformation :/)
- Deploy Cloudformation stack with this yaml file
- Build webapp & lambda codes
$ cd web && yarn install && yarn build $ cd ../lambda && yarn install && yarn build
- Deploy built code using CLI or manually
- Retrieve CI User Access Key information in CloudFormation stack output & configure your CLI to use it (
aws configure
) - Execute CLI commands
$ cd web && aws s3 cp ./build/ s3://quicksight-cognito-web-app-s3 --recursive $ cd ../lambda && aws lambda update-function-code --function-name quicksight-cognito-lambda --zip-file fileb://lambda.zip --publish
- Retrieve CI User Access Key information in CloudFormation stack output & configure your CLI to use it (
- Configure Quicksight to allow your frontend domain url to display an embedded dashboard
- Retrieve your domain name in Cloudformation stack output
- Go to
Domains & Integration
in Quicksight and add your domain name to the list
- Create Quicksight Dashboard & and complete Lambda
QUICKSIGHT_DASHBOARD_ID
environment variable with dashboard id
-
COGNITO_IDENTITY_POOL_ID (configured by Cloudformation)
-
COGNITO_USER_POOL_URL (configured by Cloudformation)
-
STS_ROLE_ARN_TO_ASSUME (configured by Cloudformation)
-
QUICKSIGHT_REGION (configured by Cloudformation)
-
QUICKSIGHT_DASHBOARD_ID (configured manually)
-
AWS_ACCOUNT_ID (configured by Cloudformation)
-
AWS_REGION (configured by Cloudformation)