ServiceNow CMDB CI relationship sync: faster, more complete →
Mods
Turbot

Policy: Turbot > Firehose > AWS SNS > Notification Template > Notification Subject

Configures the subject for SNS notification.

Resource Types

This policy targets the following resource types:

Primary Policy

This policy is used with the following primary policy:

Policy Specification

Schema Type
string
Default
{% input %}
query notificationGet($id: ID!) {
  notification(id: $id) {
    notificationType
    data
    message

    control {
      type {
        title
      }
    }

    action {
      turbot {
        id
      }
    }

    policySetting {
      type {
        trunk {
          items {
            turbot {
              title
            }
          }
        }
        turbot {
          title
        }
      }
    }
    oldPolicySetting {
      type {
        trunk {
          items {
            turbot {
              title
            }
          }
        }
        turbot {
          title
        }
      }
    }
    policyValue {
      precedence
      value
      type {
        uri
        title
        turbot {
          id
        }
        trunk { title }
      }
    }

    oldPolicyValue {
      precedence
      value
      state
      turbot {
        id
        createTimestamp
        updateTimestamp
      }
      type {
        trunk { title }
      }
    }

    resource {
      turbot {
        title
      }
      type {
        turbot {
          title
        }
      }
    }
    oldResource {
      turbot {
        title
      }
      type {
        turbot {
          title
        }
      }
    }
    grant{
      identity {
        turbot {
          title
        }
      }
      resource {
        turbot {
          title
        }
      }
      level {
        turbot {
          title
        }
      }
      type {
        turbot {
          title
        }
      }
    }
    activeGrant {
      grant {
        identity {
          turbot {
            title
          }
        }
        resource {
          turbot {
            title
          }
        }
        level {
          turbot {
            title
          }
        }
        type {
          turbot {
            title
          }
        }
      }
    }
    oldActiveGrant {
      grant {
        identity {
          turbot {
            title
          }
        }
        resource {
          turbot {
            title
          }
        }
        level {
          turbot {
            title
          }
        }
        type {
          turbot {
            title
          }
        }
      }
    }
    actor {
      identity {
        title
        turbot {
          title
        }
      }
    }

    favorite {
      name
      resource {
        turbot {
          title
        }
      }
      turbot {
        id
      }
    }

    oldFavorite {
      name
      resource {
        turbot {
          title
        }
      }
      turbot {
        id
      }
    }

    turbot {
      createTimestamp
    }
  }
}
{% endinput %}
{%- set notificationTitle = "" -%}

{%- if $.notification.notificationType === "policy_setting_created" -%}
{%- set notificationTitle -%}
Policy {{ $.notification.policySetting.type.trunk.items[$.notification.policySetting.type.trunk.items.length-2].turbot.title }} > {{ $.notification.policySetting.type.turbot.title }} set on {{ $.notification.resource.type.turbot.title }} {{ $.notification.resource.turbot.title }} by {{ $.notification.actor.identity.turbot.title }}
{%- endset -%}

{%- elif $.notification.notificationType === "policy_setting_updated" -%}
{%- set notificationTitle -%}
Policy {{ $.notification.oldPolicySetting.type.trunk.items[$.notification.policySetting.type.trunk.items.length-2].turbot.title }} > {{ $.notification.oldPolicySetting.type.turbot.title }} updated for {{ $.notification.resource.type.turbot.title }} {{ $.notification.resource.turbot.title }} by {{ $.notification.actor.identity.turbot.title }}
{%- endset -%}

{%- elif $.notification.notificationType === "resource_created" -%}
{%- set notificationTitle -%}
{{ $.notification.resource.type.turbot.title }} {{ $.notification.resource.turbot.title }} created by {{ $.notification.actor.identity.turbot.title }}
{%- endset -%}

{%- elif $.notification.notificationType === "resource_updated" -%}
{%- set notificationTitle -%}
{{ $.notification.resource.type.turbot.title }} {{ $.notification.resource.turbot.title }} updated by {{ $.notification.actor.identity.turbot.title }}
{%- endset -%}

{%- elif $.notification.notificationType === "grant_created" -%}
{%- set notificationTitle -%}
{{ $.notification.grant.type.turbot.title}}/{{ $.notification.grant.level.turbot.title}} granted at {{ $.notification.grant.resource.turbot.title }} to {{ $.notification.grant.identity.turbot.title }} by {{ $.notification.actor.identity.turbot.title }}
{%- endset -%}

{%- elif $.notification.notificationType === "active_grants_created" -%}
{%- set notificationTitle -%}
{{ $.notification.activeGrant.grant.type.turbot.title}}/{{ $.notification.activeGrant.grant.level.turbot.title}} grant activated at {{ $.notification.activeGrant.grant.resource.turbot.title }} for {{ $.notification.activeGrant.grant.identity.turbot.title }} by {{ $.notification.actor.identity.turbot.title }}
{%- endset -%}

{%- elif $.notification.notificationType === "control_created" -%}
{%- set notificationTitle -%}
Control {{ $.notification.control.type.title }} created by {{ $.notification.actor.identity.turbot.title }}
{%- endset -%}

{%- elif $.notification.notificationType === "control_updated" -%}
{%- set notificationTitle -%}
Control {{ $.notification.control.type.title }} updated by {{ $.notification.actor.identity.turbot.title }}
{%- endset -%}

{%- elif $.notification.notificationType === "control_notify" -%}
{%- set notificationTitle -%}
{{ $.notification.control.type.title }}: {{ $.notification.message }}
{%- endset -%}

{%- elif $.notification.notificationType === "action_notify" -%}
{%- set notificationTitle -%}
Action {{ $.notification.action.turbot.id }}: {{ $.notification.message }}
{%- endset -%}


{%- elif $.notification.notificationType === "policy_value_created" -%}
{%- set notificationTitle -%}
Policy value {{ $.notification.policyValue.type.trunk.title }} in {{ $.notification.resource.type.turbot.title }} {{ $.notification.resource.turbot.title }} created by {{ $.notification.actor.identity.turbot.title }}
{%- endset -%}

{%- elif $.notification.notificationType === "policy_value_updated" -%}
{%- set notificationTitle -%}
Policy value {{ $.notification.policyValue.type.trunk.title }} in {{ $.notification.resource.type.turbot.title }} {{ $.notification.resource.turbot.title }} updated by {{ $.notification.actor.identity.turbot.title }}
{%- endset -%}

{%- elif $.notification.notificationType === "favorite_created" -%}
{%- set notificationTitle -%}
Favorite for {{ $.notification.favorite.resource.turbot.title }} created by {{ $.notification.actor.identity.turbot.title }}
{%- endset -%}

{%- elif $.notification.notificationType === "favorite_updated" -%}
{%- set notificationTitle -%}
Favorite for {{ $.notification.favorite.resource.turbot.title }} updated by {{ $.notification.actor.identity.turbot.title }}
{%- endset -%}

{%- elif $.notification.notificationType === "watch_created" -%}
{%- set notificationTitle -%}
Watch for {{ $.notification.resource.turbot.title }} created by {{ $.notification.actor.identity.turbot.title }}
{%- endset -%}

{%- elif $.notification.notificationType === "watch_updated" -%}
{%- set notificationTitle -%}
Watch for {{ $.notification.resource.turbot.title }} updated by {{ $.notification.actor.identity.turbot.title }}
{%- endset -%}

{%- endif -%}

[{{ tenant.name }}] {{ notificationTitle }}

Category

In Your Workspace

Developers