I’m deploying some lambda functions and at the end, I need to print the complete URL of the latest CloudWatch log stream. So that other users can view the log directly by clicking the URL.
I’ve tried the below, but I need to print the complete URL.
print("CloudWatch log stream name:", context.log_stream_name)
I believe this can be done by using describe_log_streams along with some tweaks. But I’m helpless where to start.
2
Answers
I tried the below code and its working as expected, please comment for any improvement.
It can be done much easier (just replace "$" before replacing other special characters, then "$" doesn’t require any special treating is as "escape character"):