Hey team ,
I have been trying to create the analysis, dataset , dashboard in the target account (prod) taking assets(already present) from the dev account. Here is my cloud formation template. It is first creating a dataset, followed by template, analysis and dashboard. The datasource is already there in prod.
But it is failing while uploading even if the template is valid. saying- Invalid dataSourceArn: arn:aws:rds:us-east-1:437681213065:db:data-monitoring-20200914191548044600000002 (please refer below code)
Wanted to ask, the specifics that we are providing below is of the source account or target account?
For example: Please check code below, and could anyone let me know, what details to specify in DataSourceArn? Is it the ARN present in the source account dataset or some new arn we have to give?
Resources:
QSTCFBuildQSDataSet:
Type: AWS::QuickSight::DataSet
Properties:
DataSetId: !Join
- ‘’
- - QSTCF-DataSet
- !Ref Suffix
Name: !Join
- ‘’
- - QSTCF-DataSet
- !Ref Suffix
AwsAccountId: !Ref AWS::AccountId
PhysicalTableMap:
PhysicalTable1:
S3Source:
DataSourceArn: arn:aws:rds:us-east-1:885770418550:db:data-monitoring-20200102184109387500000001
#move to prod
BELOW IS THE TOTAL CODE: Please suggest
AWSTemplateFormatVersion: "2010-09-09"
Description: "Automated deployment of QuickSight Analysis"
Parameters:
1stReadMe:
Type: String
Default: README
Description: 'PREREQUISITES - 1) QuickSight should be setup on the aws account, 2) An user with author/admin role should be setup in QuickSight. 3)SPICE capacity should be available in the region where you are creating this stack.'
QuickSightIdentityRegion:
Type: String
MinLength: 1
Default: us-east-1
Description: REQUIRED - QuickSight identity region (region where your users are managed; run list-users command and check the user arn if you are not sure of the identity region).
QuickSightUser:
Type: String
MinLength: 1
Default: ***
Description: REQUIRED - User name of QuickSight author/admin from default namespace (as displayed in QuickSight admin panel). Dashboard created by this template with be shared with this user.
AppEnvironment:
Type: String
Default: dev
AccountVpc:
Type: AWS::EC2::VPC::Id
Description: Account VPC
Default: ****
Suffix:
Type: String
Description: OPTIONAL - If you need to create multiple instances of this sample on same aws account, add a short NUMERIC suffix here.
Resources:
QSTCFBuildQSDataSet:
Type: AWS::QuickSight::DataSet
Properties:
DataSetId: !Join
- ''
- - QSTCF-DataSet
- !Ref Suffix
Name: !Join
- ''
- - QSTCF-DataSet
- !Ref Suffix
AwsAccountId: !Ref AWS::AccountId
PhysicalTableMap:
PhysicalTable1:
S3Source:
DataSourceArn: arn:aws:rds:us-east-1:885770418550:db:data-monitoring-20200102184109387500000001
InputColumns:
- Name: datasetname
Type: STRING
- Name: datasettype
Type: STRING
- Name: bucketname
Type: STRING
- Name: datasetcreatetime
Type: STRING
- Name: arrival_time
Type: STRING
- Name: time
Type: STRING
- Name: fileparsedate
Type: STRING
- Name: date
Type: STRING
- Name: carr_acctg_cd
Type: STRING
- Name: CARR_ACCTG_CD
Type: STRING
- Name: CARR_NM_1
Type: STRING
- Name: MIN_HOUR
Type: STRING
- Name: MinHour in Minutes from Zero hour
Type: STRING
- Name: MAX_HOUR
Type: STRING
- Name: MaxHour in Minutes from Zero hour
Type: STRING
# UploadSettings:
# ContainsHeader: true
# Delimiter: ','
# Format: CSV
# StartFromRow: 1
# TextQualifier: DOUBLE_QUOTE
Permissions:
- Principal: !Join
- ''
- - 'arn:aws:quicksight:'
- !Ref QuickSightIdentityRegion
- ':'
- !Ref AWS::AccountId
- ':user/default/'
- !Ref QuickSightUser
Actions:
- quicksight:UpdateDataSetPermissions
- quicksight:DescribeDataSet
- quicksight:DescribeDataSetPermissions
- quicksight:PassDataSet
- quicksight:DescribeIngestion
- quicksight:ListIngestions
- quicksight:UpdateDataSet
- quicksight:DeleteDataSet
- quicksight:CreateIngestion
- quicksight:CancelIngestion
ImportMode: SPICE
QSTCFBuildQSTemplate:
Type: 'AWS::QuickSight::Template'
Properties:
TemplateId: "missing_files_parse_date_compare_date_trend-Template"
Name: "missing_files_parse_date_compare_date_trend-Template"
AwsAccountId: !Ref AWS::AccountId
SourceEntity:
SourceTemplate:
Arn: 'arn:aws:quicksight:us-east-1:885770418550:template/missing_files_parse_date_compare_date_trend-Template'
Permissions:
- Principal: !Join
- ''
- - 'arn:aws:quicksight:'
- !Ref QuickSightIdentityRegion
- ':'
- !Ref 'AWS::AccountId'
- ':user/default/'
- !Ref QuickSightUser
Actions:
- 'quicksight:DescribeTemplate'
VersionDescription: Initial version - Copied over from AWS account
QSRSBuildQSAnalysis:
Type: 'AWS::QuickSight::Analysis'
Properties:
AnalysisId: 'fdb55fdb-831c-472e-805d-e00b9051d10a'
Name: 'missing_files_parse_date_compare_date_trend analysis'
AwsAccountId: !Ref AWS::AccountId
SourceEntity:
SourceTemplate:
Arn: !GetAtt QSTCFBuildQSTemplate.Arn
DataSetReferences:
- DataSetPlaceholder: 'missing_files_parse_date_compare_date_trend'
DataSetArn: !GetAtt QSTCFBuildQSTemplate.Arn
Permissions:
- Principal: !Join
- ''
- - 'arn:aws:quicksight:'
- !Ref QuickSightIdentityRegion
- ':'
- !Ref 'AWS::AccountId'
- ':user/default/'
- !Ref QuickSightUser
Actions:
- 'quicksight:RestoreAnalysis'
- 'quicksight:UpdateAnalysisPermissions'
- 'quicksight:DeleteAnalysis'
- 'quicksight:DescribeAnalysisPermissions'
- 'quicksight:QueryAnalysis'
- 'quicksight:DescribeAnalysis'
- 'quicksight:UpdateAnalysis'
QSTCFBuildQSDashboard:
Type: AWS::QuickSight::Dashboard
Properties:
DashboardId: !Join
- ''
- - QSTCF-Dashboard
- !Ref Suffix
Name: !Join
- ''
- - QSTCF-Dashboard
- !Ref Suffix
AwsAccountId: !Ref AWS::AccountId
SourceEntity:
SourceTemplate:
Arn: !GetAtt QSTCFBuildQSTemplate.Arn
DataSetReferences:
- DataSetPlaceholder: missing_files_parse_date_compare_date_trend
DataSetArn: !GetAtt QSTCFBuildQSDataSet.Arn
Permissions:
- Principal: !Join
- ''
- - 'arn:aws:quicksight:'
- !Ref QuickSightIdentityRegion
- ':'
- !Ref AWS::AccountId
- ':user/default/'
- !Ref QuickSightUser
Actions:
- quicksight:DescribeDashboard
- quicksight:ListDashboardVersions
- quicksight:UpdateDashboardPermissions
- quicksight:QueryDashboard
- quicksight:UpdateDashboard
- quicksight:DeleteDashboard
- quicksight:DescribeDashboardPermissions
- quicksight:UpdateDashboardPublishedVersion
# ThemeArn: !GetAtt QSTCFBuildQSTheme.Arn
# DashboardPublishOptions:
# AdHocFilteringOption:
# AvailabilityStatus: DISABLED
Waiting for a response.
Really want to see, if after uploading this template i will be able to see a dataset/analysis and a dashboard being populated in the target account. Or we have to specify something more for the quicksight.
Thank you.