Skip to content

Commit c5aa223

Browse files
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.
1 parent 819d47e commit c5aa223

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

bin/terraform.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ EOF
7878
# http://redsymbol.net/articles/bash-exit-traps/
7979
trap clean_root_owned_docker_files EXIT
8080

81+
function import() {
82+
local -i retcode
83+
#shellcheck disable=SC2086
84+
$DOCKER_TERRAFORM import "$@"
85+
}
86+
8187
function show() {
8288
local -i retcode
8389
#shellcheck disable=SC2086
@@ -173,8 +179,11 @@ show)
173179
output)
174180
Message="Executing terraform output."
175181
;;
182+
import)
183+
Message="Executing terraform import."
184+
;;
176185
*)
177-
echo 'Unrecognized verb "'"$verb"'" specified. Use plan, plan-destroy, apply, or show' 1>&2
186+
echo 'Unrecognized verb "'"$verb"'" specified. Use apply, plan, plan-destroy, import, output or show' 1>&2
178187
exit 1
179188
;;
180189
esac

terraform/newrelic.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ provider "newrelic" {
1010
# Create an alert policy
1111
resource "newrelic_alert_policy" "alert" {
1212
name = "Alert"
13+
count = "${length(var.newrelic_apm_entities) > 0 ? (var.newrelic_alerts ? 1 : 0) : 0}"
1314
}
1415

1516
# Add a condition

0 commit comments

Comments
 (0)