diff --git a/Makefile b/Makefile index 5bfd681..4702798 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,7 @@ pack: clean fetch-dependencies # deploy-test: pack aws s3 cp ./dist/function/build.zip s3://${S3_BUCKET}/${TEST_S3_KEY} --profile ${AWS_USER} - aws --region us-east-1 lambda update-function-code --function-name ${TEST_FUNCTION_NAME} --s3-bucket ${S3_BUCKET} --s3-key ${TEST_S3_KEY} --profile ${AWS_USER} + aws --region us-east-1 lambda update-function-code --function-name ${TEST_FUNCTION_NAME} --s3-bucket ${S3_BUCKET} --s3-key ${TEST_S3_KEY} --profile ${AWS_USER} > /dev/null # # Copy the code from the test environment to @@ -98,5 +98,5 @@ deploy-test: pack # deploy-run: aws s3 cp s3://${S3_BUCKET}/${TEST_S3_KEY} s3://${S3_BUCKET}/${RUN_S3_KEY} --profile ${AWS_USER} - aws lambda update-function-code --function-name ${RUN_FUNCTION_NAME} --s3-bucket ${S3_BUCKET} --s3-key ${RUN_S3_KEY} --profile ${AWS_USER} + aws lambda update-function-code --function-name ${RUN_FUNCTION_NAME} --s3-bucket ${S3_BUCKET} --s3-key ${RUN_S3_KEY} --profile ${AWS_USER} > /dev/null diff --git a/src/logging_help.py b/src/logging_help.py index 67ed54f..e4cde35 100644 --- a/src/logging_help.py +++ b/src/logging_help.py @@ -28,8 +28,11 @@ def get_parameter(): region_name = "us-east-1" ssm_client = boto3.client('ssm', region_name=region_name) - response = ssm_client.get_parameter(Name=paramter_name) - return response['Parameters']['Value'] + response = ssm_client.get_parameter( + Name=paramter_name, + WithDecryption=True + ) + return response['Parameter']['Value'] def get_secret(): @@ -115,6 +118,7 @@ def log_msg(message): if submission.status_code != 200: # or submission.json['status'] != "ok": print('Got status {}'.format(submission.status_code)) + print(submission.json()) #raise ValueError('Got status {}'.format(submission.status_code)) @@ -122,7 +126,7 @@ def log_msg(message): def log_scan(db_data): log_env = get_env() - logdna = get_secret() + logdna = get_parameter() logdata = { @@ -147,4 +151,5 @@ def log_scan(db_data): submission = requests.post('https://logs.logdna.com/logs/ingest?hostname=GLIMPSE&now={}'.format(int(time.time())), json=logdata, headers=h_data, auth=HTTPBasicAuth(logdna, '')) if submission.status_code != 200: # or submission.json['status'] != "ok": - raise ValueError('Got status {}'.format(submission.status_code)) + print('Got status {}'.format(submission.status_code)) + #raise ValueError('Got status {}'.format(submission.status_code))