Skip to content

Instantly share code, notes, and snippets.

@cmaster11
Created April 30, 2021 16:09
Show Gist options
  • Save cmaster11/922303b272c6f30d237566ab721b41dc to your computer and use it in GitHub Desktop.
Save cmaster11/922303b272c6f30d237566ab721b41dc to your computer and use it in GitHub Desktop.
Markdium-Track your infrastructure events with AWS SNS and Notify17
label: SNS catch-all
title: |
{{
default
(
printf
"SNS message - %s"
(last (splitList ":" .TopicArn))
)
.Subject
}}
content: |-
{{ if isJson .Message }}
{{/* Decode the message and dump its content */}}
{{ dump (parseJson .Message) }}
{{ else }}
{{/* This is a normal text message */}}
{{ .Message }}
{{ if .attributesMap }}
{{/* If we have any attributes, let's show them */}}
Attributes: {{ dump .attributesMap | nindent 2 }}
{{ end }}
{{ end }}
testFieldType: yaml
testBodyYAML: |-
Message: Hello there!
MessageAttributes:
name:
Type: String
Value: General Kenobi
MessageId: 88302c8d-9d71-514c-bbb8-746c487fde28
Subject: Greetings!
Timestamp: 2021-04-26T03:01:02.694Z
TopicArn: arn:aws:sns:us-east-1:123:test-sns-template
attributesMap:
name: General Kenobi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment