How to access an Elastic Beanstalk environment property from an ebextensions config file

0 votes

In Elastic Beanstalk, is it possible to reference an Environment Property from an .ebextensions *.config file?

For example, using Cloud Formation I've added the following Environment Property to the environment that is created -

- Namespace: "aws:elasticbeanstalk:application:environment"
  OptionName:  "LOAD_USER_PROFILE"
  Value:       !Ref "LoadUserProfile"

This property is added and displays as expected under the Environment Properties section of the Software Configuraion for my environment -

However, when I try to access the property via an .ebextensions *.config file, it fails with the following error -

Error occurred during build: Command loaduserprofile failed

Here is the command from my *.config file (derived from the answer given here), which works if I hardcode true or false in place of {$LOAD_USER_PROFILE} -.

container_commands:
  loaduserprofile:
    command: appcmd set apppool "DefaultAppPool" -processModel.loadUserProfile:"{$LOAD_USER_PROFILE}"
    cwd: C:\\Windows\\System32\\inetsrv

Is what I am trying to acheive possible, and if so, what am I doing wrong?

Sep 4, 2018 in AWS by bug_seeker
• 15,510 points
5,308 views

1 answer to this question.

0 votes
The statement that they are passed into the application as environment variables can be misleading.

They are actually passed as properties to your application, so it depends on what application you are deploying in EB. It appears you are using IIS/.Net so the property name and values are added to the web.config as per the answer below:

How to read Elastic Beanstalk Environment Properties in .net?
answered Sep 4, 2018 by Priyaj
• 58,020 points

Related Questions In AWS

0 votes
1 answer

How to copy a folder from S3 to Elastic Beanstalk instance on its creation?

I had encountered similar problem. But i ...READ MORE

answered Aug 24, 2018 in AWS by Archana
• 4,170 points
4,620 views
+1 vote
1 answer

How to make an application private on AWS Elastic Beanstalk?

Like you said by default, your application ...READ MORE

answered Oct 25, 2018 in AWS by Archana
• 5,640 points
2,315 views
0 votes
1 answer
0 votes
0 answers

How can I migrate Elastic beanstalk env from one region to another on AWS?

I need help! How can i migrate ...READ MORE

Sep 18, 2020 in AWS by anonymous
• 19,610 points
1,792 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP