diff --git a/RDS_Golden_Templates/main.tf b/RDS_Golden_Templates/main.tf deleted file mode 100644 index 04e2238..0000000 --- a/RDS_Golden_Templates/main.tf +++ /dev/null @@ -1,74 +0,0 @@ -provider "dynatrace" { - api_url = var.dynatrace_api_url - api_token = var.dynatrace_api_token -} - -resource "dynatrace_dashboard" "s3_dashboard" { - name = var.dashboard_name - - # S3 Bucket Size - tile { - name = "S3 Bucket Size" - tile_type = "GRAPH" - entity_type = "AWS_S3_BUCKET" - metrics { - key = "aws.s3.bucket.size" - aggregation = "sum" - } - } - - # S3 Get Requests - tile { - name = "S3 Get Requests" - tile_type = "GRAPH" - entity_type = "AWS_S3_BUCKET" - metrics { - key = "aws.s3.bucket.get_requests" - aggregation = "count" - } - } - - # S3 Put Requests - tile { - name = "S3 Put Requests" - tile_type = "GRAPH" - entity_type = "AWS_S3_BUCKET" - metrics { - key = "aws.s3.bucket.put_requests" - aggregation = "count" - } - } - - # S3 4xx Errors - tile { - name = "S3 4xx Errors" - tile_type = "GRAPH" - entity_type = "AWS_S3_BUCKET" - metrics { - key = "aws.s3.bucket.errors_4xx" - aggregation = "sum" - } - } - - # S3 5xx Errors - tile { - name = "S3 5xx Errors" - tile_type = "GRAPH" - entity_type = "AWS_S3_BUCKET" - metrics { - key = "aws.s3.bucket.errors_5xx" - aggregation = "sum" - } - } - - # S3 Total Request Latency - tile { - name = "S3 Total Request Latency" - tile_type = "GRAPH" - entity_type = "AWS_S3_BUCKET" - metrics { - key = "aws.s3.bucket.total_request_latency" - aggregation = "avg" - } - } -} diff --git a/RDS_Golden_Templates/output.tf b/RDS_Golden_Templates/output.tf deleted file mode 100644 index c79ae39..0000000 --- a/RDS_Golden_Templates/output.tf +++ /dev/null @@ -1,9 +0,0 @@ -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/RDS_Golden_Templates/varibales.tf b/RDS_Golden_Templates/varibales.tf deleted file mode 100644 index 9f84350..0000000 --- a/RDS_Golden_Templates/varibales.tf +++ /dev/null @@ -1,21 +0,0 @@ -variable "dynatrace_api_url" { - description = "The Dynatrace API URL for your environment." - type = string -} - -variable "dynatrace_api_token" { - description = "The Dynatrace API token with permission to create dashboards." - type = string - sensitive = true -} - -variable "s3_bucket_name" { - description = "The name of the AWS S3 bucket you want to monitor." - type = string -} - -variable "dashboard_name" { - description = "Name of the Dynatrace dashboard for S3 monitoring." - type = string - default = "AWS S3 Monitoring" -} diff --git a/S3_Golden_Templates/output.tf b/golden-templates/output.tf similarity index 100% rename from S3_Golden_Templates/output.tf rename to golden-templates/output.tf 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.tf b/golden-templates/rds.tf new file mode 100644 index 0000000..2d380b2 --- /dev/null +++ b/golden-templates/rds.tf @@ -0,0 +1,773 @@ +resource "dynatrace_json_dashboard" "comos_rds_dasboard_terraform" { + contents = jsonencode( + { + "dashboardMetadata" : { + "name" : "comos_rds_dasboard_terraform", + "shared" : true, + "owner" : "Dynatrace", + "tags" : [ + "cosmos" + ], + "preset" : true + }, + "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/S3_Golden_Templates/main.tf b/golden-templates/s3.tf similarity index 94% rename from S3_Golden_Templates/main.tf rename to golden-templates/s3.tf index 2d1ea7d..f3e90ca 100644 --- a/S3_Golden_Templates/main.tf +++ b/golden-templates/s3.tf @@ -1,16 +1,7 @@ -terraform { - required_providers { - dynatrace = { - version = "~> 1.0" - source = "dynatrace-oss/dynatrace" - } - } -} - resource "dynatrace_json_dashboard" "comos_s3_bucket" { contents = jsonencode({ "dashboardMetadata": { - "name": "test_s3_dashboard", + "name": "comos_s3_bucket_terraform", "shared": true, "owner": "Dynatrace", "tags": [ diff --git a/S3_Golden_Templates/variables.tf b/golden-templates/variables.tf similarity index 95% rename from S3_Golden_Templates/variables.tf rename to golden-templates/variables.tf index a19dd70..fe17965 100644 --- a/S3_Golden_Templates/variables.tf +++ b/golden-templates/variables.tf @@ -1,4 +1,4 @@ + variable "tenant_vars" { type = any -} - +} \ No newline at end of file