        {
            "Sid": "ElasticSearchFullAccess",
            "Action": ["es:*"],
            "Effect": "Allow",
            "Resource": [
            {%- for esdomain in items %}
                "arn:aws:es:{{ region }}:{{ account_number }}:domain/{{ esdomain }}/*"
                {%- if not loop.last -%}
                ,
                {%- endif -%}
            {% endfor %}
            ]
        }
