2

Alright, so I get you can define environment variables within an environment.config file in the .ebextensions folder.

But let's say I want the AWS Account ID to be available as an environment variable here. Is there a way to dynamically retrieve that value given the context in which the Elastic BeanStalk application is deployed?

Also is there a way to refer to other environment variables within the config file? For example, given we're working within .ebextensions/environment.config:

aws:elasticbeanstalk:application:environment:
  foo: '123'
  bar: hello-${foo}

Any pointers are greatly appreciated here, thanks!

Sam S.
  • 348
  • 1
  • 3
  • 15
  • So I don't think my latter suggestion is allowed. I believe it's a strict mapping from the onset. – Sam S. Sep 18 '17 at 17:27

1 Answers1

2

Per the documentation, the aws sts get-caller-identity command can be used to retrieve the AWS Account ID.

Regarding your second question, I believe .config files are in YAML format, which would mean that you cannot reuse a value as part of another value. See this thread for more information.

Brian
  • 5,300
  • 2
  • 26
  • 32