How to sign up for Quicksight using CDK

Can someone help with the order of CDK constructs to use to get a Quicksight example running? Using typescript. The very first thing is signing up for it. Can the CDK do that? I need to give the account a name, add IAM role, give authentication method, access to Athena, and a region. Thanks

Hello @japeter89, welcome to the QuickSight community! There is a lot of functionality within QuickSight that can be managed through the API and AWS SDK. Here I will link documentation for utilizing the CreateAccountSubscription command to make your QuickSight account (account name, authentication method, admin group, etc), and then another document that explains the CreateDataSource method to attach your Athena account.

I will do some digging into CDK specific functionality and see if I can find similar commands that are available in the SDK and follow-up with my findings.

Here is some documentation related to making that Athena datasource connection through the AWS CDK.

My guess is that you cannot use the cdk to create a quicksight account. You have to use the api. Am I correct?

Hello @japeter89, based on my research that seems to be the case! After account creation though, the remaining resources all seem to be similarly managed through the CDK.

Hi @DylanM ,
So I run this code and I don’t see an error but It is not creating the quicksight account.


    (async () => {
      try {
        const response = await axios.post(
          `https://quicksight.aws.amazon.com/account/${config.AWSAccountID}`,
          {
            AccountName: "myquicksightaccount",
            AuthenticationMethod: "IAM_AND_QUICKSIGHT",
            Edition: "ENTERPRISE",
            EmailAddress: "test@test.com",
          }
        );
      } catch (error) {
        console.log("error: ", error);
      }
    })();

Hello @japeter89, my first thought is you need a real email in that EmailAddress parameter so the initial admin user can receive the sign in email from the QuickSight account. Otherwise you will have no way to access the new account.

Another option that may be even better for your use case is to create your QuickSight account template in a YAML file and run it through a Lambda. This is something I have done before because you can specify the InitialUserEmailParameter, attach the account to a Cognito account, and create an admin user. It also gives you the option of customizing the login email the users will receive when they are added to the account. Here is some documentation from AWS to provide more information on that process.

If you need further help with this process, please post a new topic in the community and link to this thread to provide relevant information. Our team prioritizes 0 reply questions and then questions without a current solution, so it will ensure you receive a faster response from one of our QuickSight experts. Thank you!