AEM Cloud Config Pipeline Failed due to YAML parsing error
We tried to whitelist domains only for specific IP addresses. Given the large number of domains and IP addresses, we aimed to make the configuration more readable and manageable by separating the lists into different files using the YAML lookup method as shown below:
- name: domains-ip-restriction
when:
allOf:
- reqProperty: domain
in: "{{ lookup('file', 'restricted_domains.yaml') }}"
- reqProperty: clientIp
notIn: "{{ lookup('file', 'whitelisted_ips.yaml') }}"
action:
type: block
restricted_domains.yaml:
- dev.domain1.com
- dev.domain2.com
whitelisted_ips.yaml:
- 172.143.23.10/32
However, the config pipeline failed with the following error logs:
2024-09-24T18:22:28+0000 Summary of events during the deployment step:
2024-09-24T18:22:28+0000 Begin deployment in sites-dev [CorrelationId: XXX]
2024-09-24T18:23:15+0000 Config Pipeline update status is failed
2024-09-24T18:23:15+0000 Error details are present:
2024-09-24T18:23:15+0000 Could not parse yaml file in 'restricted_domains.yaml'. Please check that you are using valid YAML syntax and check the documentation
2024-09-24T18:23:15+0000 Finished deployment in aaaem-sites-dev
We are aware that IP Allowlist can be configured via Cloud Manager for restricted websites. However, in our case, some domains need to be publicly accessible, which is why we are using this approach with CDN configuration.
Any suggestions on how to proceed with separate files for the IPs and domain lists, or is the only approach to duplicate these lists directly in the cdn.yaml file?
