diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..b1ce605 Binary files /dev/null and b/.DS_Store differ diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..a473a6b --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,24 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: "(GHA)" + reviewers: + - "UKHomeOffice/core-cloud-devops" + labels: + - "dependencies" + - "patch" + - package-ecosystem: "terraform" + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: "(TF)" + reviewers: + - "UKHomeOffice/core-cloud-devops" + labels: + - "dependencies" + - "patch" \ No newline at end of file diff --git a/.github/workflows/pull-request-sast.yaml b/.github/workflows/pull-request-sast.yaml new file mode 100644 index 0000000..06872de --- /dev/null +++ b/.github/workflows/pull-request-sast.yaml @@ -0,0 +1,26 @@ +name: Validate Terraform with Trivy + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + +jobs: + RunTerraformValidation: + name: Run Terraform SAST + runs-on: ubuntu-latest + + steps: + - name: Clone the Repository + uses: actions/checkout@v4 + + # Results have to be a table as the organisation does not have Advanced Security license. + - name: Terraform Trivy Scan + uses: aquasecurity/trivy-action@0.19.0 + with: + scan-type: 'config' + exit-code: '1' diff --git a/.github/workflows/pull-request-semver-label-check.yaml b/.github/workflows/pull-request-semver-label-check.yaml new file mode 100644 index 0000000..89fecce --- /dev/null +++ b/.github/workflows/pull-request-semver-label-check.yaml @@ -0,0 +1,39 @@ +name: 'Check PR for SemVer Label' +on: + pull_request: + types: + - labeled + - unlabeled + - opened + - reopened + - synchronize + branches: + - main + +permissions: + pull-requests: read + contents: read + +jobs: + semver-check: + name: 'Check PR for SemVer Label' + if: | + contains(github.event.pull_request.labels.*.name, 'skip-release') == false + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Parse the SemVer label + id: label + uses: UKHomeOffice/match-label-action@v1 + with: + labels: minor,major,patch + mode: singular + + - name: Calculate SemVer value + id: calculate + uses: UKHomeOffice/semver-calculate-action@v2 + with: + increment: ${{ steps.label.outputs.matchedLabels }} + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pull-request-semver-tag-merge.yaml b/.github/workflows/pull-request-semver-tag-merge.yaml new file mode 100644 index 0000000..146e0ca --- /dev/null +++ b/.github/workflows/pull-request-semver-tag-merge.yaml @@ -0,0 +1,46 @@ +name: 'SemVer Tag on Main Merge' +on: + pull_request: + types: + - closed + branches: + - main + +permissions: + pull-requests: read + contents: write + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false + +jobs: + semver-tag: + name: 'Tag Repository with SemVer' + if: | + github.event.pull_request.merged == true && + contains(github.event.pull_request.labels.*.name, 'skip-release') == false + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Parse the SemVer label + id: label + uses: UKHomeOffice/match-label-action@v1 + with: + labels: minor,major,patch + mode: singular + + - name: Calculate SemVer value + id: calculate + uses: UKHomeOffice/semver-calculate-action@v2 + with: + increment: ${{ steps.label.outputs.matchedLabels }} + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Tag Repository + uses: UKHomeOffice/semver-tag-action@v4 + with: + tag: ${{ steps.calculate.outputs.version }} + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..5b9c368 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + 1729162180705 + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 7866664..cd1a89a 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# core-cloud-dynatrace-golden-dashboards-terraform +Note: as we dont have any metrics in Dynatarce as of yet, these templates do not contain the dimensions fo rnow, these will be updated once we have got metrics coming into dynatrace. diff --git a/files/rds_latest.tf b/files/rds_latest.tf new file mode 100644 index 0000000..12f1f7e --- /dev/null +++ b/files/rds_latest.tf @@ -0,0 +1,7 @@ +# resource "dynatrace_document" "this" { +# type = "dashboard" +# name = "latest_dashboards_rds" +# content = file("./rds.json") +# } + +# #data "dynatrace_documents" "all-dashboard-and-notebooks" {} \ No newline at end of file diff --git a/golden-templates/msk.tf b/golden-templates/msk.tf new file mode 100644 index 0000000..fcbc47c --- /dev/null +++ b/golden-templates/msk.tf @@ -0,0 +1,958 @@ +resource "dynatrace_json_dashboard" "comos_msk_dasboard_terraform" { + contents = jsonencode( + { + "dashboardMetadata" : { + "name" : var.dashbaord_name + "shared" : var.shared + "owner" : var.owner_name + "tags" : [ + "cosmos" + ], + "preset" : var.preset + }, + "tiles": [ + { + "name": "PartitionCount", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 38, + "left": 0, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "Data explorer results", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.kafka.partitionCountByBrokerID", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "GRAPH_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "Y axis", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE", + "showLabels": false + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=null&(ext:cloud.aws.kafka.partitionCountByBrokerID:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + }, + { + "name": "MemoryUsed", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 38, + "left": 304, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "Data explorer results", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.kafka.memoryUsedByBrokerID", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "GRAPH_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE", + "showLabels": false + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=null&(ext:cloud.aws.kafka.memoryUsedByBrokerID:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + }, + { + "name": "BytesInPerSec", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 38, + "left": 608, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "Data explorer results", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.kafka.bytesInPerSecSumByBrokerIDTopic", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "GRAPH_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE", + "showLabels": false + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=null&(ext:cloud.aws.kafka.bytesInPerSecSumByBrokerIDTopic:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + }, + { + "name": "BytesOutPerSec", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 38, + "left": 912, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "Data explorer results", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.kafka.bytesOutPerSecSumByBrokerIDTopic", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "GRAPH_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE", + "showLabels": false + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=null&(ext:cloud.aws.kafka.bytesOutPerSecSumByBrokerIDTopic:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + }, + { + "name": "CpuUser", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 342, + "left": 0, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "Data explorer results", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.kafka.cpuUserSumByBrokerID", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "GRAPH_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE", + "showLabels": false + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=null&(ext:cloud.aws.kafka.cpuUserSumByBrokerID:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + }, + { + "name": "CpuSystem", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 342, + "left": 304, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "Data explorer results", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.kafka.cpuSystemSumByBrokerID", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "GRAPH_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE", + "showLabels": false + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=null&(ext:cloud.aws.kafka.cpuSystemSumByBrokerID:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + }, + { + "name": "KafkaDataLogsDiskUsed", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 342, + "left": 608, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "Data explorer results", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.kafka.kafkaAppLogsDiskUsedByBrokerID", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "GRAPH_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE", + "showLabels": false + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=null&(ext:cloud.aws.kafka.kafkaAppLogsDiskUsedByBrokerID:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + }, + { + "name": "NetworkTxPackets", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 342, + "left": 912, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "Data explorer results", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.kafka.networkRxPacketsByBrokerID", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "GRAPH_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE", + "showLabels": false + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=null&(ext:cloud.aws.kafka.networkRxPacketsByBrokerID:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + }, + { + "name": "NetworkTxPackets", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 38, + "left": 1216, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "Data explorer results", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.kafka.networkRxPacketsByBrokerID", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "GRAPH_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE", + "showLabels": false + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=null&(ext:cloud.aws.kafka.networkRxPacketsByBrokerID:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + } + ] +}) +} \ No newline at end of file diff --git a/golden-templates/output.tf b/golden-templates/output.tf new file mode 100644 index 0000000..377b4f3 --- /dev/null +++ b/golden-templates/output.tf @@ -0,0 +1,9 @@ +# output "s3_dashboard_id" { +# description = "The ID of the created Dynatrace S3 dashboard." +# value = dynatrace_dashboard.s3_dashboard.id +# } + +# output "s3_dashboard_url" { +# description = "The URL to access the S3 monitoring dashboard in Dynatrace." +# value = dynatrace_dashboard.s3_dashboard.url +# } diff --git a/golden-templates/provider.tf b/golden-templates/provider.tf new file mode 100644 index 0000000..59ee8ed --- /dev/null +++ b/golden-templates/provider.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + dynatrace = { + version = "~> 1.0" + source = "dynatrace-oss/dynatrace" + } + } +} \ No newline at end of file diff --git a/golden-templates/rds.json b/golden-templates/rds.json new file mode 100644 index 0000000..093322b --- /dev/null +++ b/golden-templates/rds.json @@ -0,0 +1,757 @@ +// { +// "name": "FreeableMemory", +// "tileType": "DATA_EXPLORER", +// "configured": true, +// "bounds": { +// "top": 0, +// "left": 38, +// "width": 266, +// "height": 266 +// }, +// "tileFilter": {}, +// "isAutoRefreshDisabled": false, +// "customName": "Data explorer results", +// "queries": [ +// { +// "id": "A", +// "metric": "ext:cloud.aws.rds.freeableMemoryByRegionEngineName", +// "spaceAggregation": "AUTO", +// "timeAggregation": "DEFAULT", +// "splitBy": [], +// "sortBy": "DESC", +// "sortByDimension": "", +// "filterBy": { +// "nestedFilters": [], +// "criteria": [] +// }, +// "limit": 20, +// "rate": "NONE", +// "enabled": true +// } +// ], +// "visualConfig": { +// "type": "GRAPH_CHART", +// "global": {}, +// "rules": [ +// { +// "matcher": "A:", +// "properties": { +// "color": "DEFAULT" +// }, +// "seriesOverrides": [] +// } +// ], +// "axes": { +// "xAxis": { +// "displayName": "", +// "visible": true +// }, +// "yAxes": [ +// { +// "displayName": "", +// "visible": true, +// "min": "AUTO", +// "max": "AUTO", +// "position": "LEFT", +// "queryIds": [ +// "A" +// ], +// "defaultAxis": true +// } +// ] +// }, +// "heatmapSettings": { +// "yAxis": "VALUE" +// }, +// "thresholds": [ +// { +// "axisTarget": "LEFT", +// "rules": [ +// { +// "color": "#7dc540" +// }, +// { +// "color": "#f5d30f" +// }, +// { +// "color": "#dc172a" +// } +// ], +// "visible": true +// } +// ], +// "tableSettings": { +// "hiddenColumns": [] +// }, +// "graphChartSettings": { +// "connectNulls": false +// }, +// "honeycombSettings": { +// "showHive": true, +// "showLegend": true, +// "showLabels": false +// } +// }, +// "queriesSettings": { +// "resolution": "" +// }, +// "metricExpressions": [ +// "resolution=null&(ext:cloud.aws.rds.freeableMemoryByRegionEngineName:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" +// ] +// }, +// { +// "name": "DatabaseConnections", +// "tileType": "DATA_EXPLORER", +// "configured": true, +// "bounds": { +// "top": 0, +// "left": 380, +// "width": 304, +// "height": 266 +// }, +// "tileFilter": {}, +// "isAutoRefreshDisabled": false, +// "customName": "DatabaseConnections", +// "queries": [ +// { +// "id": "A", +// "metric": "ext:cloud.aws.rds.databaseConnectionsSum", +// "spaceAggregation": "AUTO", +// "timeAggregation": "DEFAULT", +// "splitBy": [], +// "sortBy": "DESC", +// "sortByDimension": "", +// "filterBy": { +// "nestedFilters": [], +// "criteria": [] +// }, +// "limit": 20, +// "rate": "NONE", +// "enabled": true +// } +// ], +// "visualConfig": { +// "type": "SINGLE_VALUE", +// "global": {}, +// "rules": [ +// { +// "matcher": "A:", +// "properties": { +// "color": "DEFAULT" +// }, +// "seriesOverrides": [] +// } +// ], +// "axes": { +// "xAxis": { +// "visible": true +// }, +// "yAxes": [] +// }, +// "heatmapSettings": { +// "yAxis": "VALUE" +// }, +// "singleValueSettings": { +// "showTrend": true, +// "showSparkLine": true, +// "linkTileColorToThreshold": true +// }, +// "thresholds": [ +// { +// "axisTarget": "LEFT", +// "rules": [ +// { +// "color": "#7dc540" +// }, +// { +// "color": "#f5d30f" +// }, +// { +// "color": "#dc172a" +// } +// ], +// "visible": true +// } +// ], +// "tableSettings": { +// "hiddenColumns": [] +// }, +// "graphChartSettings": { +// "connectNulls": false +// }, +// "honeycombSettings": { +// "showHive": true, +// "showLegend": true, +// "showLabels": false +// } +// }, +// "queriesSettings": { +// "resolution": "" +// }, +// "metricExpressions": [ +// "resolution=Inf&(ext:cloud.aws.rds.databaseConnectionsSum:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", +// "resolution=null&(ext:cloud.aws.rds.databaseConnectionsSum:splitBy():sort(value(auto,descending)):limit(20))" +// ] +// }, +// { +// "name": "CPUUtilization", +// "nameSize": "medium", +// "tileType": "DATA_EXPLORER", +// "configured": true, +// "bounds": { +// "top": 0, +// "left": 760, +// "width": 304, +// "height": 304 +// }, +// "tileFilter": {}, +// "isAutoRefreshDisabled": false, +// "customName": "CPUUtilization", +// "queries": [ +// { +// "id": "A", +// "metric": "ext:cloud.aws.ec.cpuUtilization", +// "spaceAggregation": "AUTO", +// "timeAggregation": "DEFAULT", +// "splitBy": [], +// "sortBy": "DESC", +// "sortByDimension": "", +// "filterBy": { +// "nestedFilters": [], +// "criteria": [] +// }, +// "limit": 20, +// "rate": "NONE", +// "enabled": true +// } +// ], +// "visualConfig": { +// "type": "SINGLE_VALUE", +// "global": {}, +// "rules": [ +// { +// "matcher": "A:", +// "properties": { +// "color": "DEFAULT" +// }, +// "seriesOverrides": [] +// } +// ], +// "axes": { +// "xAxis": { +// "visible": true +// }, +// "yAxes": [] +// }, +// "heatmapSettings": { +// "yAxis": "VALUE" +// }, +// "singleValueSettings": { +// "showTrend": true, +// "showSparkLine": true, +// "linkTileColorToThreshold": true +// }, +// "thresholds": [ +// { +// "axisTarget": "LEFT", +// "rules": [ +// { +// "color": "#7dc540" +// }, +// { +// "color": "#f5d30f" +// }, +// { +// "color": "#dc172a" +// } +// ], +// "visible": true +// } +// ], +// "tableSettings": { +// "hiddenColumns": [] +// }, +// "graphChartSettings": { +// "connectNulls": false +// }, +// "honeycombSettings": { +// "showHive": true, +// "showLegend": true, +// "showLabels": false +// } +// }, +// "queriesSettings": { +// "resolution": "" +// }, +// "metricExpressions": [ +// "resolution=Inf&(ext:cloud.aws.ec.cpuUtilization:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", +// "resolution=null&(ext:cloud.aws.ec.cpuUtilization:splitBy():sort(value(auto,descending)):limit(20))" +// ] +// }, +// { +// "name": "FreeStorageSpace", +// "nameSize": "medium", +// "tileType": "DATA_EXPLORER", +// "configured": true, +// "bounds": { +// "top": 342, +// "left": 0, +// "width": 304, +// "height": 304 +// }, +// "tileFilter": {}, +// "isAutoRefreshDisabled": false, +// "customName": "FreeStorageSpace", +// "queries": [ +// { +// "id": "A", +// "metric": "ext:cloud.aws.rds.freeStorageSpace", +// "spaceAggregation": "AUTO", +// "timeAggregation": "DEFAULT", +// "splitBy": [], +// "sortBy": "DESC", +// "sortByDimension": "", +// "filterBy": { +// "nestedFilters": [], +// "criteria": [] +// }, +// "limit": 20, +// "rate": "NONE", +// "enabled": true +// } +// ], +// "visualConfig": { +// "type": "PIE_CHART", +// "global": {}, +// "rules": [ +// { +// "matcher": "A:", +// "properties": { +// "color": "DEFAULT" +// }, +// "seriesOverrides": [] +// } +// ], +// "axes": { +// "xAxis": { +// "visible": true +// }, +// "yAxes": [] +// }, +// "heatmapSettings": { +// "yAxis": "VALUE" +// }, +// "thresholds": [ +// { +// "axisTarget": "LEFT", +// "rules": [ +// { +// "color": "#7dc540" +// }, +// { +// "color": "#f5d30f" +// }, +// { +// "color": "#dc172a" +// } +// ], +// "visible": true +// } +// ], +// "tableSettings": { +// "hiddenColumns": [] +// }, +// "graphChartSettings": { +// "connectNulls": false +// }, +// "honeycombSettings": { +// "showHive": true, +// "showLegend": true, +// "showLabels": false +// } +// }, +// "queriesSettings": { +// "resolution": "" +// }, +// "metricExpressions": [ +// "resolution=Inf&(ext:cloud.aws.rds.freeStorageSpace:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" +// ] +// }, +// { +// "name": "ReadLatency", +// "tileType": "DATA_EXPLORER", +// "configured": true, +// "bounds": { +// "top": 342, +// "left": 380, +// "width": 304, +// "height": 304 +// }, +// "tileFilter": {}, +// "isAutoRefreshDisabled": false, +// "customName": "ReadLatency", +// "queries": [ +// { +// "id": "A", +// "metric": "ext:cloud.aws.rds.readLatency", +// "spaceAggregation": "AUTO", +// "timeAggregation": "DEFAULT", +// "splitBy": [], +// "sortBy": "DESC", +// "sortByDimension": "", +// "filterBy": { +// "nestedFilters": [], +// "criteria": [] +// }, +// "limit": 20, +// "rate": "NONE", +// "enabled": true +// } +// ], +// "visualConfig": { +// "type": "SINGLE_VALUE", +// "global": {}, +// "rules": [ +// { +// "matcher": "A:", +// "properties": { +// "color": "DEFAULT" +// }, +// "seriesOverrides": [] +// } +// ], +// "axes": { +// "xAxis": { +// "visible": true +// }, +// "yAxes": [] +// }, +// "heatmapSettings": { +// "yAxis": "VALUE" +// }, +// "singleValueSettings": { +// "showTrend": true, +// "showSparkLine": true, +// "linkTileColorToThreshold": true +// }, +// "thresholds": [ +// { +// "axisTarget": "LEFT", +// "rules": [ +// { +// "color": "#7dc540" +// }, +// { +// "color": "#f5d30f" +// }, +// { +// "color": "#dc172a" +// } +// ], +// "visible": true +// } +// ], +// "tableSettings": { +// "hiddenColumns": [] +// }, +// "graphChartSettings": { +// "connectNulls": false +// }, +// "honeycombSettings": { +// "showHive": true, +// "showLegend": true, +// "showLabels": false +// } +// }, +// "queriesSettings": { +// "resolution": "" +// }, +// "metricExpressions": [ +// "resolution=Inf&(ext:cloud.aws.rds.readLatency:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", +// "resolution=null&(ext:cloud.aws.rds.readLatency:splitBy():sort(value(auto,descending)):limit(20))" +// ] +// }, +// { +// "name": "WriteLatency", +// "tileType": "DATA_EXPLORER", +// "configured": true, +// "bounds": { +// "top": 342, +// "left": 760, +// "width": 304, +// "height": 304 +// }, +// "tileFilter": {}, +// "isAutoRefreshDisabled": false, +// "customName": "WriteLatency", +// "queries": [ +// { +// "id": "A", +// "metric": "ext:cloud.aws.rds.writeLatency", +// "spaceAggregation": "AUTO", +// "timeAggregation": "DEFAULT", +// "splitBy": [], +// "sortBy": "DESC", +// "sortByDimension": "", +// "filterBy": { +// "nestedFilters": [], +// "criteria": [] +// }, +// "limit": 20, +// "rate": "NONE", +// "enabled": true +// } +// ], +// "visualConfig": { +// "type": "SINGLE_VALUE", +// "global": {}, +// "rules": [ +// { +// "matcher": "A:", +// "properties": { +// "color": "DEFAULT" +// }, +// "seriesOverrides": [] +// } +// ], +// "axes": { +// "xAxis": { +// "visible": true +// }, +// "yAxes": [] +// }, +// "heatmapSettings": { +// "yAxis": "VALUE" +// }, +// "singleValueSettings": { +// "showTrend": true, +// "showSparkLine": true, +// "linkTileColorToThreshold": true +// }, +// "thresholds": [ +// { +// "axisTarget": "LEFT", +// "rules": [ +// { +// "color": "#7dc540" +// }, +// { +// "color": "#f5d30f" +// }, +// { +// "color": "#dc172a" +// } +// ], +// "visible": true +// } +// ], +// "tableSettings": { +// "hiddenColumns": [] +// }, +// "graphChartSettings": { +// "connectNulls": false +// }, +// "honeycombSettings": { +// "showHive": true, +// "showLegend": true, +// "showLabels": false +// } +// }, +// "queriesSettings": { +// "resolution": "" +// }, +// "metricExpressions": [ +// "resolution=Inf&(ext:cloud.aws.rds.writeLatency:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", +// "resolution=null&(ext:cloud.aws.rds.writeLatency:splitBy():sort(value(auto,descending)):limit(20))" +// ] +// }, +// { +// "name": "NetworkReceiveThroughput", +// "nameSize": "medium", +// "tileType": "DATA_EXPLORER", +// "configured": true, +// "bounds": { +// "top": 722, +// "left": 0, +// "width": 304, +// "height": 304 +// }, +// "tileFilter": {}, +// "isAutoRefreshDisabled": false, +// "customName": "NetworkReceiveThroughput", +// "queries": [ +// { +// "id": "A", +// "metric": "ext:cloud.aws.rds.networkReceiveThroughput", +// "spaceAggregation": "AUTO", +// "timeAggregation": "DEFAULT", +// "splitBy": [], +// "sortBy": "DESC", +// "sortByDimension": "", +// "filterBy": { +// "nestedFilters": [], +// "criteria": [] +// }, +// "limit": 20, +// "rate": "NONE", +// "enabled": true +// } +// ], +// "visualConfig": { +// "type": "SINGLE_VALUE", +// "global": {}, +// "rules": [ +// { +// "matcher": "A:", +// "properties": { +// "color": "DEFAULT" +// }, +// "seriesOverrides": [] +// } +// ], +// "axes": { +// "xAxis": { +// "visible": true +// }, +// "yAxes": [] +// }, +// "heatmapSettings": { +// "yAxis": "VALUE" +// }, +// "singleValueSettings": { +// "showTrend": true, +// "showSparkLine": true, +// "linkTileColorToThreshold": true +// }, +// "thresholds": [ +// { +// "axisTarget": "LEFT", +// "rules": [ +// { +// "color": "#7dc540" +// }, +// { +// "color": "#f5d30f" +// }, +// { +// "color": "#dc172a" +// } +// ], +// "visible": true +// } +// ], +// "tableSettings": { +// "hiddenColumns": [] +// }, +// "graphChartSettings": { +// "connectNulls": false +// }, +// "honeycombSettings": { +// "showHive": true, +// "showLegend": true, +// "showLabels": false +// } +// }, +// "queriesSettings": { +// "resolution": "" +// }, +// "metricExpressions": [ +// "resolution=Inf&(ext:cloud.aws.rds.networkReceiveThroughput:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", +// "resolution=null&(ext:cloud.aws.rds.networkReceiveThroughput:splitBy():sort(value(auto,descending)):limit(20))" +// ] +// }, +// { +// "name": "NetworkTransmitThroughpu", +// "nameSize": "medium", +// "tileType": "DATA_EXPLORER", +// "configured": true, +// "bounds": { +// "top": 722, +// "left": 380, +// "width": 304, +// "height": 304 +// }, +// "tileFilter": {}, +// "isAutoRefreshDisabled": false, +// "customName": "NetworkTransmitThroughpu", +// "queries": [ +// { +// "id": "A", +// "metric": "ext:cloud.aws.rds.networkTransmitThroughput", +// "spaceAggregation": "AUTO", +// "timeAggregation": "DEFAULT", +// "splitBy": [], +// "sortBy": "DESC", +// "sortByDimension": "", +// "filterBy": { +// "nestedFilters": [], +// "criteria": [] +// }, +// "limit": 20, +// "rate": "NONE", +// "enabled": true +// } +// ], +// "visualConfig": { +// "type": "SINGLE_VALUE", +// "global": {}, +// "rules": [ +// { +// "matcher": "A:", +// "properties": { +// "color": "DEFAULT" +// }, +// "seriesOverrides": [] +// } +// ], +// "axes": { +// "xAxis": { +// "visible": true +// }, +// "yAxes": [] +// }, +// "heatmapSettings": { +// "yAxis": "VALUE" +// }, +// "singleValueSettings": { +// "showTrend": true, +// "showSparkLine": true, +// "linkTileColorToThreshold": true +// }, +// "thresholds": [ +// { +// "axisTarget": "LEFT", +// "rules": [ +// { +// "color": "#7dc540" +// }, +// { +// "color": "#f5d30f" +// }, +// { +// "color": "#dc172a" +// } +// ], +// "visible": true +// } +// ], +// "tableSettings": { +// "hiddenColumns": [] +// }, +// "graphChartSettings": { +// "connectNulls": false +// }, +// "honeycombSettings": { +// "showHive": true, +// "showLegend": true, +// "showLabels": false +// } +// }, +// "queriesSettings": { +// "resolution": "" +// }, +// "metricExpressions": [ +// "resolution=Inf&(ext:cloud.aws.rds.networkTransmitThroughput:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", +// "resolution=null&(ext:cloud.aws.rds.networkTransmitThroughput:splitBy():sort(value(auto,descending)):limit(20))" +// ] +// } \ No newline at end of file diff --git a/golden-templates/rds.tf b/golden-templates/rds.tf new file mode 100644 index 0000000..bff1ef2 --- /dev/null +++ b/golden-templates/rds.tf @@ -0,0 +1,773 @@ +resource "dynatrace_json_dashboard" "comos_rds_dasboard_terraform" { + contents = jsonencode( + { + "dashboardMetadata" : { + "name" : var.dashbaord_name + "shared" : var.shared + "owner" : var.owner_name + "tags" : [ + "cosmos" + ], + "preset" : var.preset + }, + "tiles": [ + { + "name": "FreeableMemory", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 0, + "left": 38, + "width": 266, + "height": 266 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "Data explorer results", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.rds.freeableMemoryByRegionEngineName", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "GRAPH_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE" + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=null&(ext:cloud.aws.rds.freeableMemoryByRegionEngineName:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + }, + { + "name": "DatabaseConnections", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 0, + "left": 380, + "width": 304, + "height": 266 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "DatabaseConnections", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.rds.databaseConnectionsSum", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "SINGLE_VALUE", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "visible": true + }, + "yAxes": [] + }, + "heatmapSettings": { + "yAxis": "VALUE" + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=Inf&(ext:cloud.aws.rds.databaseConnectionsSum:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", + "resolution=null&(ext:cloud.aws.rds.databaseConnectionsSum:splitBy():sort(value(auto,descending)):limit(20))" + ] + }, + { + "name": "CPUUtilization", + "nameSize": "medium", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 0, + "left": 760, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "CPUUtilization", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.ec.cpuUtilization", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "SINGLE_VALUE", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "visible": true + }, + "yAxes": [] + }, + "heatmapSettings": { + "yAxis": "VALUE" + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=Inf&(ext:cloud.aws.ec.cpuUtilization:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", + "resolution=null&(ext:cloud.aws.ec.cpuUtilization:splitBy():sort(value(auto,descending)):limit(20))" + ] + }, + { + "name": "FreeStorageSpace", + "nameSize": "medium", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 342, + "left": 0, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "FreeStorageSpace", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.rds.freeStorageSpace", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "PIE_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "visible": true + }, + "yAxes": [] + }, + "heatmapSettings": { + "yAxis": "VALUE" + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=Inf&(ext:cloud.aws.rds.freeStorageSpace:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + }, + { + "name": "ReadLatency", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 342, + "left": 380, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "ReadLatency", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.rds.readLatency", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "SINGLE_VALUE", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "visible": true + }, + "yAxes": [] + }, + "heatmapSettings": { + "yAxis": "VALUE" + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=Inf&(ext:cloud.aws.rds.readLatency:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", + "resolution=null&(ext:cloud.aws.rds.readLatency:splitBy():sort(value(auto,descending)):limit(20))" + ] + }, + { + "name": "WriteLatency", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 342, + "left": 760, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "WriteLatency", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.rds.writeLatency", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "SINGLE_VALUE", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "visible": true + }, + "yAxes": [] + }, + "heatmapSettings": { + "yAxis": "VALUE" + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=Inf&(ext:cloud.aws.rds.writeLatency:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", + "resolution=null&(ext:cloud.aws.rds.writeLatency:splitBy():sort(value(auto,descending)):limit(20))" + ] + }, + { + "name": "NetworkReceiveThroughput", + "nameSize": "medium", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 722, + "left": 0, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "NetworkReceiveThroughput", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.rds.networkReceiveThroughput", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "SINGLE_VALUE", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "visible": true + }, + "yAxes": [] + }, + "heatmapSettings": { + "yAxis": "VALUE" + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=Inf&(ext:cloud.aws.rds.networkReceiveThroughput:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", + "resolution=null&(ext:cloud.aws.rds.networkReceiveThroughput:splitBy():sort(value(auto,descending)):limit(20))" + ] + }, + { + "name": "NetworkTransmitThroughpu", + "nameSize": "medium", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 722, + "left": 380, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "NetworkTransmitThroughpu", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.rds.networkTransmitThroughput", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "SINGLE_VALUE", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "visible": true + }, + "yAxes": [] + }, + "heatmapSettings": { + "yAxis": "VALUE" + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=Inf&(ext:cloud.aws.rds.networkTransmitThroughput:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", + "resolution=null&(ext:cloud.aws.rds.networkTransmitThroughput:splitBy():sort(value(auto,descending)):limit(20))" + ] + } + ] +}) +} \ No newline at end of file diff --git a/golden-templates/s3.tf b/golden-templates/s3.tf new file mode 100644 index 0000000..5317f1d --- /dev/null +++ b/golden-templates/s3.tf @@ -0,0 +1,551 @@ +resource "dynatrace_json_dashboard" "s3_dashboard_template" { + contents = jsonencode( + { + "dashboardMetadata": { + "name": var.dashbaord_name + "shared": var.shared + "owner": var.owner_name + "tags": [ + "" + ], + "preset": var.preset + }, + "tiles": [ + { + "name": "BytesDownloaded", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 0, + "left": 0, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "Data explorer results", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.s3.bytesDownloadedByFilterId", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "GRAPH_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE", + "showLabels": false + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=null&(ext:cloud.aws.s3.bytesDownloadedByFilterId:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + }, + { + "name": "BytesUploaded", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 0, + "left": 304, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "Data explorer results", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.s3.bytesUploadedByFilterId", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "GRAPH_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE", + "showLabels": false + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=null&(ext:cloud.aws.s3.bytesUploadedByFilterId:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + }, + { + "name": "AllRequests", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 0, + "left": 608, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "Data explorer results", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.s3.allRequestsSumByFilterId", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "GRAPH_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE", + "showLabels": false + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=null&(ext:cloud.aws.s3.allRequestsSumByFilterId:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + }, + { + "name": "4xxErrors", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 0, + "left": 912, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "Data explorer results", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.s3.4xxErrorsByFilterId", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "GRAPH_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE", + "showLabels": false + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=null&(ext:cloud.aws.s3.\"4xxErrorsByFilterId\":splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + }, + { + "name": "5xxErrors", + "tileType": "DATA_EXPLORER", + "configured": true, + "bounds": { + "top": 304, + "left": 0, + "width": 304, + "height": 304 + }, + "tileFilter": {}, + "isAutoRefreshDisabled": false, + "customName": "Data explorer results", + "queries": [ + { + "id": "A", + "metric": "ext:cloud.aws.s3.5xxErrorsByFilterId", + "spaceAggregation": "AUTO", + "timeAggregation": "DEFAULT", + "splitBy": [], + "sortBy": "DESC", + "sortByDimension": "", + "filterBy": { + "nestedFilters": [], + "criteria": [] + }, + "limit": 20, + "rate": "NONE", + "enabled": true + } + ], + "visualConfig": { + "type": "GRAPH_CHART", + "global": {}, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE", + "showLabels": false + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, + { + "color": "#dc172a" + } + ], + "visible": true + } + ], + "tableSettings": { + "hiddenColumns": [] + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false + } + }, + "queriesSettings": { + "resolution": "" + }, + "metricExpressions": [ + "resolution=null&(ext:cloud.aws.s3.\"5xxErrorsByFilterId\":splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + ] + } + ] +}) +} \ No newline at end of file diff --git a/golden-templates/variables.tf b/golden-templates/variables.tf new file mode 100644 index 0000000..f6c1d32 --- /dev/null +++ b/golden-templates/variables.tf @@ -0,0 +1,18 @@ + +variable "tenant_vars" { + type = any +} +variable "dashbaord_name" { + type = string +} +variable "owner_name" { + type = string +} +variable "shared" { + type = string +} +variable "preset" { + type = string +} + +