Quicksight automation via cloudformation (IotAnalytics datasource)

0

Hi, i trying to automate QS with cloudformation and im stuck with datasource json template. the goal is create datasource which reference to aws iot analytics data set. I have tried everything without success.

below is mine template:

{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "--",
  "Parameters" : {
    "DataSetName" : {
      "Type" : "String",
      "Default" : "test_dataset",
      "Description" : "datasetName"
    }
  },
   "Resources": {
    "testQSdatasource": {
      "Type" : "AWS::QuickSight::DataSource",
      "Properties" : {
        "AwsAccountId" : {"Ref": "AWS::AccountId"},
        "DataSourceId" : "test_data_source_1",
        "Name" : "Analytics_data_source1",
        "Type" : "AWS_IOT_ANALYTICS",
        "DataSourceParameters": {
          "AwsIotAnalyticsParameters": {
            "DataSetName": {"Ref": "DataSetName"}
          }
        }
      }
    }
  }
}

i found also that docs not mentioned AwsIotAnalyticsParameters or anything similar that referenced to iot analytics. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-datasource-datasourceparameters.html

So is it even possible to create QS datasource which refer to iot analytics dataset?

2 Answers
0

Looks like we do not have IoT analytics supported in AWS::QuickSight::DataSource DataSourceParameters https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-datasource-datasourceparameters.html

One option could be to use CLI as referred here https://awscli.amazonaws.com/v2/documentation/api/latest/reference/quicksight/create-data-source.html. The ListDataSources has AWS_IOT_ANALYTICS in it and below

AwsIotAnalyticsParameters -> (structure)

The parameters for IoT Analytics.

DataSetName -> (string)

Dataset name.
profile pictureAWS
EXPERT
answered a year ago
  • Hi AWS-User_Nitin , I did try to create datasource also via CLI with this code:

    aws quicksight create-data-source --aws-account-id "<my-account-id>" --data-source-id "test123" --name "test123" --type "AWS_IOT_ANALYTICS" --data-source-parameters '{"AwsIotAnalyticsParameters":{"DataSetName" : "test_30_day_dataset_dev"}}'
    

    but this also fails. Here is CLI response: An error occurred (InvalidParameterValueException) when calling the CreateDataSource operation: DataSourceParameters field is incorrectly set

0

up.. I also try to create datasource via CLI with this code:

aws quicksight create-data-source --aws-account-id "<my-account-id>" --data-source-id "test123" --name "test123" --type "AWS_IOT_ANALYTICS" --data-source-parameters '{"AwsIotAnalyticsParameters":{"DataSetName" : "test_30_day_dataset_dev"}}'

but this also fails. Here is CLI response: An error occurred (InvalidParameterValueException) when calling the CreateDataSource operation: DataSourceParameters field is incorrectly set

Does someone knows what may cause that error msg?

answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions