Skip to content

Commit

Permalink
Decouple failure of ingest function creation and integration role cre…
Browse files Browse the repository at this point in the history
…ation (#20)
  • Loading branch information
hmacdonald-nr authored Nov 19, 2019
1 parent b2021d7 commit a5c5c68
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
12 changes: 7 additions & 5 deletions newrelic-cloud
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ def create_role(role_policy, nr_account_id):
if exit_code > 0:
raise Exception(response)


def create_function(region, nr_license_key):
cmd = ('aws --region {0} cloudformation create-stack '
'--stack-name NewRelicLogIngestion '
Expand Down Expand Up @@ -658,6 +657,13 @@ def enable_lambda_monitoring(args):
print("Checking for a preexisting link between NR and AWS, and validating the AWS CLI credentials")
validate_linked_account(linked_account_name, api_client)

# AWS
try:
print("Creating newrelic-log-ingestion Lambda function in your AWS account")
results = setup_log_ingestion(nr_license_key, regions)
except Exception as e:
print(str(e))

# AWS
print("Creating the AWS role for the New Relic integration")
role = create_integration_role(role_policy, nr_account_id)
Expand All @@ -672,10 +678,6 @@ def enable_lambda_monitoring(args):
enable_lamba_integration(
nr_account_id, linked_account_name, api_client)

# AWS
print("Creating newrelic-log-ingestion Lambda function in your AWS account")
results = setup_log_ingestion(nr_license_key, regions)

print("\nLambda integration is set up.\n\n"
"Next, you'll need to instrument your Lambda functions, and use \n"
"\t./newrelic-cloud stream-lambda-logs \\\n"
Expand Down

0 comments on commit a5c5c68

Please sign in to comment.