Skip to content

Commit d3c9b25

Browse files
Merge pull request #44 from ModusCreateOrg/terraform-import
Added terraform import to wrapper (fixes #36)
2 parents 819d47e + 9cfd8fa commit d3c9b25

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def wrap = { fn->
4444
}
4545
}
4646

47-
final Long XOR_CONST = 3735928559 // 0xdeadbeef
47+
final Long XOR_CONST = 4919 // 0x1337 see https://en.wikipedia.org/wiki/Leet
4848
(captcha_problem, captcha_hash) = get_captcha(XOR_CONST)
4949

5050
/** Gather properties from user parameters */

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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ provider "newrelic" {
99

1010
# Create an alert policy
1111
resource "newrelic_alert_policy" "alert" {
12-
name = "Alert"
12+
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)