Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions newrelic_lambda_cli/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ def create_log_subscription(input, function_name):
"Found log subscription for '%s', verifying configuration" % function_name
)
newrelic_filter = newrelic_filters[0]
if newrelic_filter["filterPattern"] != input.filter_pattern:
if (
newrelic_filter["filterPattern"] != input.filter_pattern
or newrelic_filter["destinationArn"] != destination_arn
):
return _remove_subscription_filter(
input.session, function_name, newrelic_filter["filterName"]
) and _create_subscription_filter(
Expand Down Expand Up @@ -189,7 +192,10 @@ def create_otel_log_subscription(input, function_name):
"Found log subscription for '%s', verifying configuration" % function_name
)
newrelic_filter = newrelic_filters[0]
if newrelic_filter["filterPattern"] != input.filter_pattern:
if (
newrelic_filter["filterPattern"] != input.filter_pattern
or newrelic_filter["destinationArn"] != destination_arn
):
return _remove_subscription_filter(
input.session, function_name, newrelic_filter["filterName"]
) and _create_subscription_filter(
Expand Down