Last active
October 4, 2017 10:41
-
-
Save mt8/2618e9db37145fb1ea09908a660f343c to your computer and use it in GitHub Desktop.
[AWS] Lambdaで出力したCloudWatchログのログストリームURLをLambda内で取得するPython(エラー調査などに便利)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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