{
    "LambdaFunctionConfigurations": [
        {% for trigger in triggers %}
        {
            "LambdaFunctionArn": "{{ lambda_arn }}",
            {% if trigger.prefix or trigger.suffix -%}
            "Filter": {
                "Key": {
                    "FilterRules": [
                        {% if trigger.prefix -%}
                        {
                            "Name": "prefix",
                            "Value": "{{ trigger.prefix }}"
                        }{% if trigger.suffix -%},{% endif -%}
                        {% endif -%}
                        {% if trigger.suffix -%}
                        {
                            "Name": "suffix",
                            "Value": "{{ trigger.suffix }}"
                        }
                        {% endif -%}
                    ]
                }
            },
            {% endif -%}
            "Events": {{ trigger.events | tojson }}
        }{% if not loop.last %},{% endif %}
        {% endfor %}
    ]
}
