Reputation: 101
I need to display live interactive graphs based on customer data present in MySQL,for generating the graphs, I am planning to use Amazon Quick Sight but i would like to know whether the generated graphs can be integrated with my web application UI ? Datasource MYSQL is hosted in AWS.
Any other better design solution is also most welcome :)
Upvotes: 8
Views: 11541
Reputation: 662
Note: This answer is applicable only if you are using AWS Cognito
In order to generate Quicksight secure dashboard URL, follow the below steps:
Step 1: Create a new Identity Pool. Go to https://console.aws.amazon.com/cognito/home?region=u-east-1 , click ‘Create new Identity Pool’
Step 2: Assign Custom policy to the Identity Pool Role
{ "Version": "2012-10-17", "Statement": [ { "Action": "quicksight:RegisterUser", "Resource": "*", "Effect": "Allow" }, { "Action": "quicksight:GetDashboardEmbedUrl", "Resource": "*", "Effect": "Allow" }, { "Action": "sts:AssumeRole", "Resource": "*", "Effect": "Allow" } ] }
Note: if you want to restrict the user to only one dashboard, replace the * with the dashboard ARN name in quicksight:GetDashboardEmbedUrl,
Step 3: Configuration for generating the temporary IAM(STS) user
Login to your application with the user credentials.
For creating temporary IAM user, we use Cognito credentials.
When user logs in, Cognito generates 3 token IDs - IDToken, AccessToken, RefreshToken. These tokens will be sent to your application server.
For creating a temporary IAM user, we use Cognito Access Token and credentials will look like below.
AWS.config.region = 'us-east-1';
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId:"Identity pool ID",
Logins: {
'cognito-idp.us-east-1.amazonaws.com/UserPoolID': AccessToken
}
});
var params = { RoleArn: "Cognito Identity role arn", RoleSessionName: "Session name" };
sts.assumeRole(params, function (err, data) { if (err) console.log( err, err.stack); // an error occurred else { console.log(data); })
Step 4: Register the User in Quicksight
var params = { AwsAccountId: “account id”, Email: 'email', IdentityType: 'IAM' , Namespace: 'default', UserRole: ADMIN | AUTHOR | READER | RESTRICTED_AUTHOR | RESTRICTED_READER, IamArn: 'Cognito Identity role arn', SessionName: 'session name given in the assume role creation', };
quicksight.registerUser(params, function (err, data1) {
if (err) console.log("err register user”); // an error occurred
else {
// console.log("Register User1”);
}
});
Step5: Update AWS configuration with New credentials.
AWS.config.update({ accessKeyId: AccessToken, secretAccessKey: SecretAccessKey , sessionToken: SessionToken, "region": Region });
Step6: Generate the EmbedURL for Dashboards:
var params = { AwsAccountId: "account ID", DashboardId: "dashboard Id", IdentityType: "IAM", ResetDisabled: true, SessionLifetimeInMinutes: between 15 to 600 minutes, UndoRedoDisabled: True | False } quicksight.getDashboardEmbedUrl(params, function (err, data) { if (!err) { console.log( data); } else { console.log(err); } } );
Upvotes: 1
Reputation: 2943
Good luck!
Update: Dec 28 2018
Amazon announced in Nov 2018, that Amazon QuickSight dashboards can now be embedded in applications. Read more here at this AWS QuickSight Update.
Upvotes: 8
Reputation: 41
AWS has enabled the embedding of the Dashboards into web apps. The feature was released on 27th Nov 2018. Here are a few helpful links:
1. https://aws.amazon.com/blogs/big-data/embed-interactive-dashboards-in-your-application-with-amazon-quicksight/
2. https://docs.aws.amazon.com/quicksight/latest/user/embedded-dashboards-setup.html
Upvotes: 4
Reputation: 9
I know this is a very late reply, but just in case someone else stumbles across this question... We use periscopedata.com to embed BI dashboards in our SaaS app. All that's needed is knowledge of SQL (to create the charts/dashboards) and enough dev knowledge to call their API endpoint to display the dash in your own app.
Upvotes: -1