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 -

enter image description here

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
• 14,970 points
558 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 56,120 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
• 3,770 points
311 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,280 points
21 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.