Skip to content

Commit 7109ee3

Browse files
author
kwest
committed
PR updates
1 parent 1e693ef commit 7109ee3

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

newrelic_lambda_cli/integrations.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,19 @@ def _get_cf_stack_status(session, stack_name, nr_account_id=None):
5050
try:
5151
res = session.client("cloudformation").describe_stacks(StackName=stack_name)
5252
if nr_account_id is not None:
53-
(stack_nr_account_id,) = _get_stack_output_value(session, ["NrAccountId"])
54-
if str(nr_account_id) not in stack_nr_account_id:
53+
stack_output_account_id = _get_stack_output_value(session, ["NrAccountId"])
54+
# Checking length of outputs here to protect against installs done with older CLI versions.
55+
# We don't want to constantly warn users who installed on previous versions with no outputs.
56+
if (
57+
len(stack_output_account_id) > 0
58+
and str(nr_account_id) not in stack_output_account_id
59+
):
5560
warning(
5661
"WARNING: Managed secret already exists in this region for New Relic account {0}.\n"
5762
"Current CLI behavior limits the setup of one managed secret per region.\n"
5863
"To set up an additional secret for New Relic account {1} see our docs:\n{2}.\n"
5964
"Or run this command with --disable-license-key-secret to avoid attemping to create a new managed secret.".format(
60-
stack_nr_account_id, nr_account_id, NR_DOCS_ACT_LINKING_URL
65+
stack_output_account_id, nr_account_id, NR_DOCS_ACT_LINKING_URL
6166
)
6267
)
6368

newrelic_lambda_cli/templates/license-key-secret.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Parameters:
2020
Default: NewRelic-ViewLicenseKeyPolicyARN
2121
NrAccountId:
2222
Type: String
23-
Default: NEW_RELIC_ACCOUNT_ID
2423

2524
Resources:
2625
LicenseKeySecret:
@@ -57,4 +56,4 @@ Outputs:
5756
NrAccountId:
5857
Value: !Ref NrAccountId
5958
Export:
60-
Name: !Sub "${NrAccountId}"
59+
Name: !Sub "${AWS::StackName}-NrAccountId"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="newrelic-lambda-cli",
9-
version="0.5.5",
9+
version="0.6.0",
1010
python_requires=">=3.3",
1111
description="A CLI to install the New Relic AWS Lambda integration and layers.",
1212
long_description=README,

0 commit comments

Comments
 (0)