Skip to content

Instantly share code, notes, and snippets.

Last active Oct 4, 2017
What would you like to do?
[AWS] Lambdaで出力したCloudWatchログのログストリームURLをLambda内で取得するPython(エラー調査などに便利)
def lambda_handler(event, context):
region = context.invoked_function_arn.split(":")[3]
request_id = context.aws_request_id
log_group_name = context.log_group_name
log_stream_name = context.log_stream_name
log_url = "https://"+region+""+region+"#logEvent:group="+log_group_name+";stream="+log_stream_name
print log_url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment