File tree Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -21,5 +21,5 @@ export BASE_DIR
2121
2222cp " $BASE_DIR /env.sh.sample" " $BASE_DIR /env.sh"
2323clean_root_owned_docker_files
24- rm -rf " $BUILD_DIR "
24+ rm -rf " $BUILD_DIR " " $BASE_DIR /terraform/.terraform "
2525mkdir " $BUILD_DIR "
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ resource "newrelic_alert_condition" "spin-appdex" {
3232
3333 condition_scope = " application"
3434
35- count = " ${ length (var. newrelic_apm_entities ) > 0 ? 1 : 0 } "
35+ count = " ${ length (var. newrelic_apm_entities ) > 0 ? (var . newrelic_alerts ? 1 : 0 ) : 0 } "
3636}
3737
3838# Add a notification channel
@@ -45,15 +45,15 @@ resource "newrelic_alert_channel" "email" {
4545 include_json_attachment = " 1"
4646 }
4747
48- count = " ${ length (var. newrelic_alert_email ) > 0 ? 1 : 0 } "
48+ count = " ${ length (var. newrelic_alert_email ) > 0 ? (var . newrelic_alerts ? 1 : 0 ) : 0 } "
4949}
5050
5151# Link the channel to the policy
5252resource "newrelic_alert_policy_channel" "alert_email" {
5353 policy_id = " ${ newrelic_alert_policy . alert . id } "
5454 channel_id = " ${ newrelic_alert_channel . email . id } "
5555
56- count = " ${ length (var. newrelic_alert_email ) > 0 ? 1 : 0 } "
56+ count = " ${ length (var. newrelic_alert_email ) > 0 ? (var . newrelic_alerts ? 1 : 0 ) : 0 } "
5757}
5858
5959# Add a dashboard
Original file line number Diff line number Diff line change @@ -96,6 +96,12 @@ variable "newrelic_apm_entities" {
9696 default = []
9797}
9898
99+ # You have to have a full-blown New Relic subscription in order to deal with Alerts
100+ variable "newrelic_alerts" {
101+ description = " Enable New Relic alerts"
102+ default = false
103+ }
104+
99105variable "newrelic_runbook_url" {
100106 description = " New Relic runbook URL"
101107 default = " https://github.com/ModusCreateOrg/devops-infra-demo/wiki/runbook"
Original file line number Diff line number Diff line change 11module "vpc" {
2- source = " github.com/terraform-aws-modules/terraform-aws-vpc"
2+ source = " terraform-aws-modules/vpc/aws"
3+ version = " ~> v1.0"
34
45 name = " infra-demo-vpc"
56
You can’t perform that action at this time.
0 commit comments