import { escape , stringify } from "querystring" ; export function getLogGroupName ( FunctionName ) { return `/aws/lambda/${ FunctionName }` ; } export function getLogUrl ( region , FunctionName ) { const logGroupName = getLogGroupName ( FunctionName ) ; const params = stringify ( { group : logGroupName } , ";" ) ; const rg = escape ( region ) ; return `https://${ rg }.console.aws.amazon.com/cloudwatch/home?region=${ rg }#logStream:${ params }` ; } export function getExecutionLogUrl ( region , logGroupName , logStreamName , executionId ) { const params = stringify ( { group : logGroupName , stream : logStreamName , filter : `"${ executionId }"` } , ";" ) ; const rg = escape ( region ) ; return `https://${ rg }.console.aws.amazon.com/cloudwatch/home?region=${ rg }#logEventViewer:${ params }` ; }