Terraform AWS Elastic Beanstalk Self reference

Viewed 238

I have a simple elastic beanstalk environment setup which has a setting for env variable.

The value however comes from the private_dns address that the backend EC2 will eventually create. It creates sort of a cycle.

resource "aws_elastic_beanstalk_environment" "tfenvtest" {
  name = "tf-test-env-name"
  ...
  setting {
    namespace = "aws:elasticbeanstalk:application:environment"
    name      = "ALLOWED_HOSTS_1"
    value     = # this should be the private_dns of EC2 created by own resource
  }

What's the best way to provide this value?

0 Answers
Related