File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ function output () {
93
93
94
94
function plan() {
95
95
local extra
96
+ local nr_app_id
96
97
local output
97
98
local -i retcode
98
99
local targets
@@ -101,6 +102,15 @@ function plan() {
101
102
targets=$( get_targets)
102
103
103
104
set +e
105
+
106
+ nr_app_id=$( curl \
107
+ -s \
108
+ -X GET \
109
+ ' https://api.newrelic.com/v2/applications.json' \
110
+ -H " X-Api-Key:${NEWRELIC_API_KEY} " \
111
+ -d " filter[name]=${NEWRELIC_APP_NAME} " \
112
+ | jq ' .applications[].id' )
113
+
104
114
# shellcheck disable=SC2086
105
115
$DOCKER_TERRAFORM plan \
106
116
$extra \
@@ -111,6 +121,7 @@ function plan() {
111
121
-var newrelic_license_key=" $NEWRELIC_LICENSE_KEY " \
112
122
-var newrelic_api_key=" $NEWRELIC_API_KEY " \
113
123
-var newrelic_alert_email=" $NEWRELIC_ALERT_EMAIL " \
124
+ -var newrelic_apm_entities=" [$nr_app_id ]" \
114
125
-var-file=" /app/build/extra.tfvars" \
115
126
-out=" $TF_PLAN " \
116
127
" $TF_DIR " \
Original file line number Diff line number Diff line change @@ -36,3 +36,4 @@ export GOOGLE_REGION=us-east1
36
36
export NEWRELIC_LICENSE_KEY=ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
37
37
export NEWRELIC_API_KEY=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
38
38
39
+ export NEWRELIC_APP_NAME=Spin
You can’t perform that action at this time.
0 commit comments