AWS Elastic Beanstalk option_settings env variable with instance ip

Viewed 537

I am deploying an application using the Elastic Beanstalk Go Platform.

I need to set an environment variable for the current private ip of the instance. (I need this environment variable to be available to my app itself, once it's run via Procfile.)

In my .ebextensions/options.config file I've tried everything but no luck yet:

{
  "option_settings": [
    {
      "namespace": "aws:elasticbeanstalk:application:environment",
      "option_name": "PRIVATE_IP",
      "value": {
        "Fn::GetAtt": [
          "Ec2Instance",
          "PrivateIp"
        ]
      }
    }
  ]
}

This example sets PRIVATE_IP to literally the entire Fn::GetAtt... json string. Are functions not interpreted in option_settings? Is there another way to go about this?

1 Answers
Related