From 4ec2ec4da0f300487256404f283dc5acb820fcff Mon Sep 17 00:00:00 2001 From: Patrick de Ruiter Date: Tue, 5 Oct 2021 11:04:22 +0200 Subject: [PATCH] ls -la --- main.tf | 6 +++--- monitors.tf | 2 +- synthetics.tf | 2 +- terraform.tfvars | 20 ++++++++++---------- variables.tf | 27 ++++++++++++++++++--------- 5 files changed, 33 insertions(+), 24 deletions(-) diff --git a/main.tf b/main.tf index 2b1baa6..aa322a7 100644 --- a/main.tf +++ b/main.tf @@ -1,6 +1,6 @@ -resource "datadog_dashboard" "beacon" { +resource "datadog_dashboard" "app_dashboard" { title = var.app_name - description = "A Datadog Dashboard for the ${kubernetes_deployment.beacon.metadata[0].name} deployment" + description = "A Datadog Dashboard for the ${var.app_name} deployment on the ${var.stage} environment" layout_type = "ordered" is_read_only = true @@ -52,7 +52,7 @@ resource "datadog_dashboard" "beacon" { widget { alert_graph_definition { - alert_id = datadog_monitor.beacon.id + alert_id = datadog_monitor.app_monitor.id title = "Kubernetes Node CPU" viz_type = "timeseries" } diff --git a/monitors.tf b/monitors.tf index 3e1c010..b8fe820 100644 --- a/monitors.tf +++ b/monitors.tf @@ -14,6 +14,6 @@ resource "datadog_monitor" "app_monitor" { notify_no_data = true - tags = ["cfa:${var.cfa_name}", "team:${var.team_name}" "app:${var.app_name}", "env:${var.stage}"] + tags = ["cfa:${var.cfa_name}", "team:${var.team_name}", "app:${var.app_name}", "env:${var.stage}"] } diff --git a/synthetics.tf b/synthetics.tf index 5fa249d..a44a3b0 100644 --- a/synthetics.tf +++ b/synthetics.tf @@ -21,7 +21,7 @@ resource "datadog_synthetics_test" "app_sythetics" { name = "${var.app_name} API check" message = "Oh no! there seems to be a problem with ${var.app_name} please investigate" - tags = ["cfa:${var.cfa_name}", "team:${var.team_name}" "app:${var.app_name}", "env:${var.stage}"] + tags = ["cfa:${var.cfa_name}", "team:${var.team_name}", "app:${var.app_name}", "env:${var.stage}"] status = "live" } diff --git a/terraform.tfvars b/terraform.tfvars index 1859463..363fb5d 100644 --- a/terraform.tfvars +++ b/terraform.tfvars @@ -1,11 +1,11 @@ app_namespace = "plaap" -app_name = "blah" -image_name = "name/image" -region = "eu-west-1" -api_key = "2fcc093ed06e4dbe0935433495898cad" -app_key = "aaf4a9654b82cfa8b23b2d65801901a4ad9d35ed" -datadog_site = "https://api.datadoghq.eu/" -aws_profile = "ws-playground-applicatiebeheer" -environment = "test" -prefix_slug = "sanoma" -team = "ws-playground-applicatiebeheer" +app_name = "blah" +image_name = "name/image" +region = "eu-west-1" +api_key = "2fcc093ed06e4dbe0935433495898cad" +app_key = "aaf4a9654b82cfa8b23b2d65801901a4ad9d35ed" +datadog_site = "https://api.datadoghq.eu/" +aws_profile = "ws-playground-applicatiebeheer" +stage = "test" +cfa_name = "sanoma" +team_name = "ws-playground-applicatiebeheer" diff --git a/variables.tf b/variables.tf index eb77985..721f10e 100644 --- a/variables.tf +++ b/variables.tf @@ -3,27 +3,36 @@ variable "app_namespace" { type = string } +variable "cfa_name" { + description = "Name of the CFA" + type = string +} + variable "app_name" { description = "Name of the application" type = string } -variable "image_name" { - description = "Name of the Docker imagei to use" +variable "team_name" { + description = "Name of the responsible team" type = string } +variable "image_name" { + description = "Name of the Docker Image" + type = string +} variable "region" { description = "Defines the AWS region where the resources are located" type = string } -variable "environment" { - description = "Specifies the URL for datadog to monitor" - type = string -} - -variable "url" { - description = "Specifies the URL for datadog to monitor" +variable "stage" { + description = "Specifies the stage to monitor (dev, tst, stg, prd)" + type = string +} + +variable "url" { + description = "Specifies the URL for datadogi Synthetics to monitor" type = string }