Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/clean-workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ export BASE_DIR

cp "$BASE_DIR/env.sh.sample" "$BASE_DIR/env.sh"
clean_root_owned_docker_files
rm -rf "$BUILD_DIR"
rm -rf "$BUILD_DIR" "$BASE_DIR/terraform/.terraform"
mkdir "$BUILD_DIR"
6 changes: 3 additions & 3 deletions terraform/newrelic.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ resource "newrelic_alert_condition" "spin-appdex" {

condition_scope = "application"

count = "${length(var.newrelic_apm_entities) > 0 ? 1 : 0}"
count = "${length(var.newrelic_apm_entities) > 0 ? (var.newrelic_alerts ? 1 : 0) : 0}"
}

# Add a notification channel
Expand All @@ -45,15 +45,15 @@ resource "newrelic_alert_channel" "email" {
include_json_attachment = "1"
}

count = "${length(var.newrelic_alert_email) > 0 ? 1 : 0}"
count = "${length(var.newrelic_alert_email) > 0 ? (var.newrelic_alerts ? 1 : 0) : 0}"
}

# Link the channel to the policy
resource "newrelic_alert_policy_channel" "alert_email" {
policy_id = "${newrelic_alert_policy.alert.id}"
channel_id = "${newrelic_alert_channel.email.id}"

count = "${length(var.newrelic_alert_email) > 0 ? 1 : 0}"
count = "${length(var.newrelic_alert_email) > 0 ? (var.newrelic_alerts ? 1 : 0) : 0}"
}

# Add a dashboard
Expand Down
6 changes: 6 additions & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ variable "newrelic_apm_entities" {
default = []
}

# You have to have a full-blown New Relic subscription in order to deal with Alerts
variable "newrelic_alerts" {
description = "Enable New Relic alerts"
default = false
}

variable "newrelic_runbook_url" {
description = "New Relic runbook URL"
default = "https://github.com/ModusCreateOrg/devops-infra-demo/wiki/runbook"
Expand Down
3 changes: 2 additions & 1 deletion terraform/vpc.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module "vpc" {
source = "github.com/terraform-aws-modules/terraform-aws-vpc"
source = "terraform-aws-modules/vpc/aws"
version = "~> v1.0"

name = "infra-demo-vpc"

Expand Down