From c5aa22347515246eaf31175b68283fc75926e335 Mon Sep 17 00:00:00 2001 From: Richard Bullington-McGuire Date: Fri, 2 Aug 2019 16:36:56 -0400 Subject: [PATCH 1/3] Added import to terraform wrapper, tweaked New Relic cfg Added import to terraform master to help address #36 New Relic was trying to mess with alerts even though the default was not to enable New Relic alerts support. --- bin/terraform.sh | 11 ++++++++++- terraform/newrelic.tf | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/terraform.sh b/bin/terraform.sh index fcd9af9..4ab99d5 100755 --- a/bin/terraform.sh +++ b/bin/terraform.sh @@ -78,6 +78,12 @@ EOF # http://redsymbol.net/articles/bash-exit-traps/ trap clean_root_owned_docker_files EXIT +function import() { + local -i retcode + #shellcheck disable=SC2086 + $DOCKER_TERRAFORM import "$@" +} + function show() { local -i retcode #shellcheck disable=SC2086 @@ -173,8 +179,11 @@ show) output) Message="Executing terraform output." ;; +import) + Message="Executing terraform import." + ;; *) - echo 'Unrecognized verb "'"$verb"'" specified. Use plan, plan-destroy, apply, or show' 1>&2 + echo 'Unrecognized verb "'"$verb"'" specified. Use apply, plan, plan-destroy, import, output or show' 1>&2 exit 1 ;; esac diff --git a/terraform/newrelic.tf b/terraform/newrelic.tf index 228a77f..e3b4199 100644 --- a/terraform/newrelic.tf +++ b/terraform/newrelic.tf @@ -10,6 +10,7 @@ provider "newrelic" { # Create an alert policy resource "newrelic_alert_policy" "alert" { name = "Alert" + count = "${length(var.newrelic_apm_entities) > 0 ? (var.newrelic_alerts ? 1 : 0) : 0}" } # Add a condition From a096dccc6ce1419d494f85d04d1e994ea3acf5a5 Mon Sep 17 00:00:00 2001 From: Richard Bullington-McGuire Date: Fri, 2 Aug 2019 16:40:39 -0400 Subject: [PATCH 2/3] Fix terraform fmt Fix Terrafmr format# --- terraform/newrelic.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/newrelic.tf b/terraform/newrelic.tf index e3b4199..78ae26e 100644 --- a/terraform/newrelic.tf +++ b/terraform/newrelic.tf @@ -9,7 +9,7 @@ provider "newrelic" { # Create an alert policy resource "newrelic_alert_policy" "alert" { - name = "Alert" + name = "Alert" count = "${length(var.newrelic_apm_entities) > 0 ? (var.newrelic_alerts ? 1 : 0) : 0}" } From 9cfd8fad76a3dfe229b154bd70d167c74e02e85b Mon Sep 17 00:00:00 2001 From: Richard Bullington-McGuire Date: Fri, 2 Aug 2019 16:58:33 -0400 Subject: [PATCH 3/3] Switch 0xdeadbeef for 0x1337 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5e981fc..ffa130e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -44,7 +44,7 @@ def wrap = { fn-> } } -final Long XOR_CONST = 3735928559 // 0xdeadbeef +final Long XOR_CONST = 4919 // 0x1337 see https://en.wikipedia.org/wiki/Leet (captcha_problem, captcha_hash) = get_captcha(XOR_CONST) /** Gather properties from user parameters */