diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f11b75 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ diff --git a/newrelic-cloud b/newrelic-cloud index c1cc487..5e8cec4 100755 --- a/newrelic-cloud +++ b/newrelic-cloud @@ -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 ' @@ -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) @@ -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"