Skip to content

Commit

Permalink
feat: add accountapp login synthetic monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
lemeurherveCB committed Jul 19, 2022
1 parent c40497b commit 7425d14
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Jenkinsfile_k8s
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ parallel(
// TODO: create an empty account for staging
string(variable: 'TF_VAR_datadog_api_key', credentialsId: 'datadog-api-key'),
string(variable: 'TF_VAR_datadog_app_key', credentialsId: 'datadog-app-key'),
string(variable: 'TF_VAR_datadog_jenkinsuser_password', credentialsId: 'datadog-jenkinsuser-password'),
file(variable: 'BACKEND_CONFIG_FILE', credentialsId: 'production-terraform-datadog-backend-config'),
],
productionCredentials: [
string(variable: 'TF_VAR_datadog_api_key', credentialsId: 'datadog-api-key'),
string(variable: 'TF_VAR_datadog_app_key', credentialsId: 'datadog-app-key'),
string(variable: 'TF_VAR_datadog_jenkinsuser_password', credentialsId: 'datadog-jenkinsuser-password'),
file(variable: 'BACKEND_CONFIG_FILE', credentialsId: 'production-terraform-datadog-backend-config'),
],
)
Expand Down
28 changes: 28 additions & 0 deletions synthetics_accountapp-login.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
resource "datadog_synthetics_test" "accountapp-login" {
type = "api"
request_definition {
method = "POST"
url = "https://accounts.jenkins.io/doLogin"
body = "userid=datadog_monitoring&password=${datadog_jenkinsuser_password}"
}
request_headers {
Content-Type = "application/x-www-form-urlencoded"
}
assertion {
type = "statusCode"
operator = "is"
target = "302"
}
locations = ["aws:eu-central-1"]
options_list {
tick_every = 900
}
name = "login account.jenkins.io"
message = "Notify @pagerduty"
tags = [
"jenkins.io",
"production"
]

status = "live"
}
1 change: 1 addition & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
variable "datadog_api_key" {}
variable "datadog_app_key" {}
variable "datadog_jenkinsuser_password" {}

0 comments on commit 7425d14

Please sign in to comment.