Hi,
I want to see in my lambda a link to a build project. My syntax:
import json
import requests
def lambda_handler(event, context):
build_status = event['detail']['build-status']
project_name = event['detail']['project-name']
build_id = event['detail']['build-id']
region = event['region']
deep_link = event['detail']['logs']['deep-link']
message = f"AWS CodeBuild project '{project_name}' has {build_status} use this link {deep_link}"
I have this error:
[ERROR] KeyError: 'logs'
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 9, in lambda_handler
deep_link = event['detail']['logs']['deep-link']
[ERROR] KeyError: 'logs' Traceback (most recent call last): File "/var/task/lambda_function.py", line 9, in lambda_handler deep_link = event['detail']['logs']['deep-link']
Based on documentation path for a deep link is correct.
Doc is here, I didn't notice additional-information - https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html. Thank you!