I need an example in typescript of how to use CfnDashboardProps in the AWS CDK. There is none to be found even in the documentation: interface CfnDashboardProps · AWS CDK
Hello @japeter89, you can import aws_quicksight from the aws-cdk-lib npn package and utilize the props available from the CfnDashboardProps documentation that you linked above. To pull your response it would look something like this:
import { aws_quicksight } from 'aws-cdk-lib';
const response = aws_quicksight.CfnDashboard {
awsAccountId: [your account id],
dashboardId: [unique dashboard id],
name: [unique dashboard id],
... other props you want to include
}
You can define parameters and themes for the dashboard as well from this template. Here is another page of documentation from AWS that lists out the available options for the command.
If a part of the process is still not clear let me know and I can try to guide you in the right direction.
Thank you, I ended up with some code here that works. Replacing with correct ARN’s and ID’s. Apparently the definition and sourceEntity props are required.
const quicksightDashboardName = "quicksight-dashboard";
const quicksightDashboard = new quicksight.CfnDashboard(
this,
quicksightDashboardName,
{
awsAccountId: "456",
dashboardId: "123",
name: quicksightDashboardName,
definition: {
dataSetIdentifierDeclarations: [
{ dataSetArn: "123", identifier: "datasets name here" },
],
},
sourceEntity: {
sourceTemplate: {
arn: "123",
dataSetReferences: [
{ dataSetArn: "123", dataSetPlaceholder: "123" },
],
},
},
}
);
Hello @japeter89, I am glad that worked! The documentation can be a lot to dig through, so if you have any more questions feel free to post a new topic in the community and one of our QuickSight experts will help you find a solution. Good luck!