I'm trying to import a Defender serverless.yml config file to provision my Defender environment using the Serverless feature and getting the following error when I try to validate the serverless.yml file:
> sls info
Configuration error:
at 'functions.send-pause-tx.trigger.type': must be equal to one of the allowed values [schedule, webhook]
at 'resources.Resources.sentinels.monitor-large-transfer': unsupported string format
Environment
Defender Serverless
Details
I set up everything in Defender manually first (contracts, relayer, autotask, and sentinel), then exported the serverless config via the Defender UI. Fwiw, I'm using the Defender workflow loosely based on the PauseGuardian.
Code to reproduce
service: defender-serverless-test-project
configValidationMode: error
frameworkVersion: '3'
provider:
name: defender
stage: ${opt:stage, 'dev'}
stackName: mystack
ssot: false
# custom:
# config: ${file(secrets.${self:provider.stage}.yml)}
defender:
key: "${env:TEAM_API_KEY}"
secret: "${env:TEAM_API_SECRET}"
functions:
send-pause-tx:
name: Send Pause TX
relayer: ${self:resources.Resources.relayers.astab-pauser}
trigger:
type: sentinel
paused: false
path: './scripts/autotasks/send-pause-tx'
resources:
Resources:
policies:
policy-kZ:
eip1559-pricing: true
policy-E4:
eip1559-pricing: true
private-transactions: false
contracts:
astab-proxy:
name: ASTAB-PROXY
address: '0x1890'
network: goerli
astab-imp:
name: ASTAB-IMP
address: '0x1B7a'
network: goerli
relayers:
astab-pauser:
name: ASTAB-PAUSER
network: goerli
min-balance: '100000000000000000'
policy: ${self:resources.Resources.policies.policy-kZ}
test-one:
name: Test øne
network: goerli
min-balance: '100000000000000000'
policy: ${self:resources.Resources.policies.policy-E4}
notifications:
unusually-large-tx-detected-on-acmestable:
type: email
name: 'Unusually Large TX Detected on ACMESTABLE '
config:
emails:
- me@removed.com
paused: false
categories:
low-severity:
name: Low Severity
description: A default category to be assigned for low risk monitors.
high-severity:
name: High Severity
description: A default category to be assigned for high risk monitors.
medium-severity:
name: Medium Severity
description: A default category to be assigned for medium risk monitors.
sentinels:
monitor-large-transfer:
name: 'Monitor Large Transfer '
type: BLOCK
network: goerli
addresses:
- '0x1890...'
paused: false
autotask-trigger: ${self:functions.send-pause-tx}
confirm-level: 1
notify-config:
timeout: 0
message: |-
**Defender Sentinel {{ sentinel.name }} Triggered**
**Network**
{{ sentinel.network }}
**Block Hash**
{{ blockHash }}
**Transaction Hash**
{{ transaction.transactionHash }}
**Explorer Link**
{{ transaction.link }}
{{ matchReasonsFormatted }}
channels:
- >-
${self:resources.Resources.notifications.unusually-large-tx-detected-on-acmestable}
conditions:
event:
- expression: value > 200000
signature: Transfer(address,address,uint256)
plugins:
- defender-serverless
It seems likely that this is the section of the config that is causing the error:
functions:
send-pause-tx:
name: Send Pause TX
relayer: ${self:resources.Resources.relayers.astab-pauser}
trigger:
type: sentinel
paused: false
path: './scripts/autotasks/send-pause-tx'
However, 'sentinel' should be a valid type, correct?
Any ideas on how to resolve this?