aws-solutions / aws-devops-monitoring-dashboard

The DevOps Monitoring Dashboard on AWS solution is a reference implementation that automates the process for monitoring and visualizing performance and operational metrics in continuous integration/continuous delivery (CI/CD) pipeline following AWS best practices.
Apache License 2.0
72 stars 35 forks source link

Can you share the solutions_aws-devops-monitoring-dashboard_v1_0_0 QuickSigth Template #6

Closed hnajera closed 3 years ago

hnajera commented 3 years ago

Is your feature request related to a problem? Please describe. I'm customizing the solution to include additional events for pipelines that deploy cloudformation templates because we are not using code deploy.

The issue is that you have this parameter: quicksight_source_template_arn in the cdk.json and i'm setting the value to: arn:aws:quicksight:us-east-1:myaccountid:template/solutions_aws-devops-monitoring-dashboard_v1_0_0 like that template doesn't exist in my account the deployment fails. My first thought was that the lambda function for the quick sight resources will create the template but it's not.

The deployment of the out of the box solution works well but is referencing the following template : arn:aws:quicksight:us-east-1:898061675696:template/solutions_aws-devops-monitoring-dashboard_v1_0_0, what I think is that the account: 898061675696 is owned by you and the template exists there and for that reason the deployment is successful.

Describe the feature you'd like If possible, can you provide the contents of the arn:aws:quicksight:us-east-1:898061675696:template/solutions_aws-devops-monitoring-dashboard_v1_0_0 quicksight template?

And from the point of view of the feature, it would be nice if the solution can include the source of the template so we can customize it and also the feature to deploy it to quicksight.

hnajera commented 3 years ago

Thanks to AWS Support I got the template using the following command:

aws quicksight create-template --aws-account-id account-id --template-id firsttemplate --source-entity file://template.json --profile default

template.json { "SourceTemplate": { "Arn": "arn:aws:quicksight:us-east-1:898061675696:template/solutions_aws-devops-monitoring-dashboard_v1_0_0" } }

aijunpeng commented 3 years ago

Thanks for the inquiry. Code pipeline metrics will be included in next release.

If you customize the solution, you will need to create the QuickSight template in your AWS account in order to successfully deploy QuickSight resources. You can do so by create template either from 1. the template in the solution's account (as you have already done) or 2. from the QuickSight analysis in your AWS account that is deployed by the out-of-box solution.

If you customize QuickSight such as datasets, analysis, etc., option 2 will allow you to create/update your template with your own analysis that includes your customization. Below are the steps for option 2:

Step 1: Run QuickSight cli commands to get analysis and dataset arns in your AWS account where the solution is deployed. aws quicksight list-analyses --aws-account-id your-aws-account-id aws quicksight list-data-sets --aws-account-id your-aws-account-id

Step 2: Fill out the json below with your information such as aws account id, QuickSight template id/name, analysis and dataset arns. Save it as a json file, for example, “create-template-from-analysis-cli-input.json”

{
    "AwsAccountId": "your-aws-account-id",
    "TemplateId": "your-quicksight-template-id",
    "Name": "your-quicksight-template-name",
    "SourceEntity": {
        "SourceAnalysis": {
            "Arn": "your-quicksight-analysis-arn",
            "DataSetReferences": [
                {
                    "DataSetPlaceholder": "code-change-activity",
                    "DataSetArn": "your-quicksight-code-change-activity-dataset-arn"
                },
                {
                    "DataSetPlaceholder": "code-deployment-detail",
                    "DataSetArn": "your-quicksight-code-deployment-detail-dataset-arn"
                },
                {
                    "DataSetPlaceholder": "recovery-time-detail",
                    "DataSetArn": "your-quicksight-recovery-time-detail-dataset-arn"
                }
            ]
        }
    },
    "PERMISSIONS":[
        {
          "Principal": "*",
          "Actions": ["quicksight:DescribeTemplate"]
        }
      ],
    "VersionDescription": "1"
}

Step 3: Run create-template command from the analysis json file aws quicksight create-template --cli-input-json file://./create-template-from-analysis-cli-input.json --region your-region

Step 4 (optional): If you customize QuickSight such as datasets, analysis, dashboard, etc., you can update the analysis json file as needed and then call update-template cli command to update your template accordingly. aws quicksight update-template --cli-input-json file://./create-template-from-analysis-cli-input.json --region your-region