Create a stack with the "old" function name, i.e. using a CLI version 0.8.0 or earlier
Attempt to update it with newrelic-lambda integrations update ... using CLI version 0.9.0
Expected Behaviour
The update should succeed, either renaming the function or preserving it with the old name.
def get_unique_newrelic_log_ingestion_name(session, stackname=None):
if not stackname:
stackname = INGEST_STACK_NAME
stack_id = _get_cf_stack_id(session, stack_name=stackname)
if stack_id:
return "newrelic-log-ingestion-%s" % (stack_id.split("/")[2].split("-")[4])
def get_newrelic_log_ingestion_function(session, stackname=None):
unique_log_ingestion_name = get_unique_newrelic_log_ingestion_name(
session, stackname
)
if unique_log_ingestion_name:
function = get_function(session, unique_log_ingestion_name)
return function
In addition, it would be nice if the logs were more specific about which function doesn't exist. I would've identified the problem with far less effort if the error printed out No newrelic-log-ingestion-0aa... function in region, given we do have function called newrelic-log-ingestion as literally appears in the error message.
Description
Testing if JIRA integration is working https://github.com/newrelic/newrelic-lambda-cli/issues/267
Steps to Reproduce
Create a stack with the "old" function name, i.e. using a CLI version 0.8.0 or earlier Attempt to update it with newrelic-lambda integrations update ... using CLI version 0.9.0
Expected Behaviour
The update should succeed, either renaming the function or preserving it with the old name.
It looks like https://github.com/newrelic/newrelic-lambda-cli/pull/254 may have introduced some if statements that aren't working as intended given its stated goal of preserving compatibility.
newrelic-lambda-cli/newrelic_lambda_cli/integrations.py
Lines 89 to 103 in f472e28
def get_unique_newrelic_log_ingestion_name(session, stackname=None): if not stackname: stackname = INGEST_STACK_NAME stack_id = _get_cf_stack_id(session, stack_name=stackname) if stack_id: return "newrelic-log-ingestion-%s" % (stack_id.split("/")[2].split("-")[4])
def get_newrelic_log_ingestion_function(session, stackname=None): unique_log_ingestion_name = get_unique_newrelic_log_ingestion_name( session, stackname ) if unique_log_ingestion_name: function = get_function(session, unique_log_ingestion_name) return function In addition, it would be nice if the logs were more specific about which function doesn't exist. I would've identified the problem with far less effort if the error printed out No newrelic-log-ingestion-0aa... function in region, given we do have function called newrelic-log-ingestion as literally appears in the error message.
Relevant Logs / Console output
Your Environment
Additional context