How to use environment variable in Dispatcher module - AEM Cloud? | Community
Skip to main content
Abhishek_Narula25
Level 3
January 31, 2024

How to use environment variable in Dispatcher module - AEM Cloud?

  • January 31, 2024
  • 1 reply
  • 3195 views

In AEM as a cloud, can we have multiple/custom variable files under conf.d/variables?

 

We are on AEM 6.5 AMS currently and migrating to AEM Cloud. We have environment specific variable files like xyz_dev.vars, xyz_stage.vars etc. and a file like 002_init_xyz_vars.conf having an include statement like:

 

PassEnv ENV_TYPE
Include /etc/httpd/conf.d/variables/xyz_${ENV_TYPE}.vars

This variable was set for each environment which will include environment specific variable file. I am trying to migrate it to Cloud compatible.

 

So, instead I tried to use:

Include conf.d/variables/xyz_${ENVIRONMENT_TYPE}.vars

I had set this variable ENVIRONMENT_TYPE=dev in CM DEV environment configuration but the CM deploy pipeline is not picking up the variable and it fails saying:

 

 

 

Config variable ${ENVIRONMENT_TYPE} is not defined httpd: Syntax error on line 357 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf.d/002_init_xyz_vars.conf: Could not open configuration file /etc/httpd/conf.d/variables/xyz_${ENVIRONMENT_TYPE}.vars: No such file or directory ERROR: '1 TEST_FAILURE '

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Abhishek_Narula25
Level 3
February 1, 2024

Hi @arunpatidar 

I had already tried these articles but nothing worked for me.