Skip to content

Instantly share code, notes, and snippets.

@mt8 mt8/lambda_function.py
Last active Oct 4, 2017

Embed
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+".console.aws.amazon.com/cloudwatch/home?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
You can’t perform that action at this time.