aws_url.ts 451 B

123456789101112131415161718
  1. const JSURL = require('jsurl');
  2. export interface AwsUrl {
  3. end: string;
  4. start: string;
  5. timeType?: 'ABSOLUTE' | 'RELATIVE';
  6. tz?: 'local' | 'UTC';
  7. unit?: string;
  8. editorString: string;
  9. isLiveTail: boolean;
  10. source: string[];
  11. }
  12. export function encodeUrl(obj: AwsUrl, region: string): string {
  13. return `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#logs-insights:queryDetail=${JSURL.stringify(
  14. obj
  15. )}`;
  16. }