Configs
Configs emit events when their health changes or when they are created, modified, or removed.
Health events
config.healthyconfig.unhealthyconfig.warningconfig.unknown
ec2-health-notification.yamlapiVersion: mission-control.flanksource.com/v1
kind: Notification
metadata:
  name: ec2-instance-health-alerts
  namespace: default
spec:
  events:
    - config.unhealthy
    - config.warning
  filter: config.type == 'AWS::EC2::Instance'
  to:
    email: alerts@acme.com

Default Template
The default notification template for health events is:
Title
{{ if ne channel "slack"}}{{.config.type}} {{.config.name}} is {{.config.health}}{{end}}
Template
{{if eq channel "slack"}}
{
	"blocks": [
		{{slackSectionTextMD (printf `%s *%s* is _%s_` (slackHealthEmoji .config.health) .config.name .config.health)}},
    {"type": "divider"},
    {{if .config.description}}{{slackSectionTextPlain .config.description}},{{end}}
		{
			"type": "section",
			"fields": [
        {{slackSectionTextFieldMD (printf `*Type*: %s` .config.type) }}
        {{if .config.status}},{{slackSectionTextFieldMD (printf `*Status*: %s` .config.status) }}{{end}}
				{{if ne .agent.name "local"}}
					,{{slackSectionTextFieldMD (printf `*Agent*: %s` .agent.name)}}
				{{end}}
			]
		},
		{{if .config.labels}}{{slackSectionLabels .config}},{{end}}
		{{if .recent_events}}{{slackSectionTextMD (printf `*Recent Events:* %v` (join .recent_events ", "))}},{{end}}
		{{if .groupedResources}}{{slackSectionTextMD (printf `*Also Failing:* %s` (join .groupedResources "\n"))}},{{end}}
		{"type": "divider"},
		{{slackURLAction "View Catalog" .permalink "🔕 Silence" .silenceURL}}
	]
}
{{else}}
{{labelsFormat .config.labels}}
[Reference]({{.permalink}})
{{end}}
State events
config.createdconfig.updatedconfig.deleted
ec2-instance-updates.yamlapiVersion: mission-control.flanksource.com/v1
kind: Notification
metadata:
  name: ec2-instance-changes
  namespace: default
spec:
  events:
    - config.created
    - config.updated
    - config.deleted
  filter: config.type == 'AWS::EC2::Instance'
  to:
    email: alerts@acme.com

Default Template
Title
{{ if ne channel "slack"}}{{.config.type}} {{.config.name}} was {{.new_state}}{{end}}
Template
{{if eq channel "slack"}}
{
	"blocks": [
		{{slackSectionTextMD (printf `:information_source: *%s* was _%s_` .config.name .new_state)}},
    {"type": "divider"},
    {{if .config.description}}{{slackSectionTextPlain .config.description}},{{end}}
		{
			"type": "section",
			"fields": [
        {{slackSectionTextFieldMD (printf `*Type*: %s` .config.type) }}
        {{if .config.status}},{{slackSectionTextFieldMD (printf `*Status*: %s` .config.status) }}{{end}}
				{{if ne .agent.name "local"}}
					,{{slackSectionTextFieldMD (printf `*Agent*: %s` .agent.name)}}
				{{end}}
			]
		},
		{{if .config.labels}}{{slackSectionLabels .config}},{{end}}
		{{if .groupedResources}}{{slackSectionTextMD (printf `*Also Failing:* %s` (join .groupedResources "\n"))}},{{end}}
		{{slackURLAction "View Catalog" .permalink "🔕 Silence" .silenceURL}}
	]
}
{{else}}
{{labelsFormat .config.labels}}
[Reference]({{.permalink}})
{{end}}
Template Variables
| Field | Description | Scheme | 
|---|---|---|
agent | Details of the agent that created the config.  | |
config | Corresponding config item.  | |
new_state | The db state change that caused this event. Only available on state events.  | 
  | 
permalink | Link to the Catalog in mission control  | string  | 
Config Item
| Field | Description | Scheme | 
|---|---|---|
config | Configuration  | string  | 
config_class | Class of the config item  | string  | 
created_at | Creation timestamp  | 
  | 
delete_reason | Reason for deletion  | string  | 
deleted_at | Deletion timestamp  | 
  | 
description | Description  | string  | 
external_id | External IDs  | 
  | 
health | 
  | 
  | 
id | ID of the config item  | 
  | 
labels | Labels  | 
  | 
name | Name  | string  | 
properties | 
  | 
  | 
ready | Whether the config item is ready  | bool  | 
scraper_id | ID of the scraper  | string  | 
source | Source  | string  | 
status | Status  | string  | 
tags | Tags  | 
  | 
type | Type  | string  | 
updated_at | Update timestamp  | 
  | 
Agent
| Field | Description | Scheme | 
|---|---|---|
description | Short description of the agent  | string  | 
id | The id of the agent  | 
  | 
name | The name of the agent  | string  |