How to create a child dataset from existing datasets in CloudFormation?

When I create a child dataset from an existing dataset in the console, describe-data-set API response says the attribute of PhysicalTableMap is empty, but CloudFormation validation says it cannot be null. Then how should I do?

Error message 1

  • Resource handler returned message: "1 validation error detected: Value null at ‘physicalTableMap’ failed to satisfy constraint: Member must not be null

I’ve tried adding the attribute of PhysicalTableMap with empty records, but it didn’t work as well.

Error message 2

  • Properties validation failed for resource AllDataSet with message: #/PhysicalTableMap: minimum size: [1], found: [0]

Hmm, this is how we have our CloudFormation dataset. It’s not using a child dataset though.

PhysicalTableMap: 
                DayDataSet: 
                    CustomSql: 
                        DataSourceArn: !Sub "arn:aws:quicksight:${AWS::Region}:${AWS::AccountId}:datasource/${DataDestinationBucket}-source"
                        Name: "DayDataSet"
                        SqlQuery: !Sub |
                            Select 
                            awsaccountid awsaccountid
                            etc...

You also need to list out columns

             Columns: 
                          - 
                            Name: "awsaccountid"
                            Type: "STRING"

Let me know if this helps at all.

For more information here is the documentation on the physical table map

Thank you for comments, but I know how to write CloudFormation when I want to deploy dataset without any parent-child relation.

Have you tried to bring in the existing resource and see if you can figure out the syntax?