Skip to content

Releases: cloudposse/terraform-aws-elastic-beanstalk-environment

Change custom ENV vars key/value calculation

03 Oct 21:12

Choose a tag to compare

What

  • Changed the way the custom ENV vars are calculated in aws:elasticbeanstalk:application:environment setting

Why

  • Using null_resource to generate key/value pairs for ENV vars like this:
resource "null_resource" "env_vars" {
  count = 50

  triggers {
    key = "${count.index < length(var.env_vars) ?
                        element(concat(keys(var.env_vars),list("")), count.index) :
                        format(var.env_default_key, count.index+1)
               }"

    value = "${count.index < length(var.env_vars) ?
                        lookup(var.env_vars, element(concat(keys(var.env_vars),list("")), count.index), var.env_default_value) :
                        var.env_default_value
                 }"
  }
}

setting {
  namespace = "aws:elasticbeanstalk:application:environment"
  name      = "${null_resource.env_vars.0.triggers.key}"
  value     = "${null_resource.env_vars.0.triggers.value}"
}
setting {
  namespace = "aws:elasticbeanstalk:application:environment"
  name      = "${null_resource.env_vars.1.triggers.key}"
  value     = "${null_resource.env_vars.1.triggers.value}"
}

DOES NOT work when it's used from top-level modules AND when there is a dependency between modules AND terraform apply or terraform plan runs for the first time (meaning no AWS resources have been created yet), e.g.

module "elastic_beanstalk_environment" {
  source        = "git::https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment.git?ref=tags/0.2.4"

  env_vars                = "${
      merge(
        map(
          "EFS_HOST", "${module.efs.dns_name}"
        ), var.env_vars
      )
    }"
}

module "efs" {
  source             = "git::https://github.com/cloudposse/terraform-aws-efs.git?ref=tags/0.3.1"
  namespace          = "${var.namespace}"
  name               = "${var.name}"
  stage              = "${var.stage}"
  security_groups    = ["${module.elastic_beanstalk_environment.security_group_id}"]
}

Terraform throws the error:

the key for null_resource.env_vars.0.triggers.key could not be found

Looks like Terraform can't resolve the module inter-dependencies when using null_resource.
The proposed way of generating key/value pairs for ENV vars works in all cases.

Add `Application Load Balancer` health check settings

28 Sep 18:09

Choose a tag to compare

What

  • Added Application Load Balancer health check settings in namespace aws:elasticbeanstalk:environment:process:default

Why

  • The ALB health check does not take into account the Elastic Beanstalk health check path

References

Support Empty Env List and Return Stable Values

25 Sep 16:37

Choose a tag to compare

0.2.3

Support Empty Env List and Return Stable Values (#11)

Add http to https redirect

22 Sep 21:17

Choose a tag to compare

Add http to https redirect

Rename Repo

22 Sep 03:33

Choose a tag to compare

What

  • Rename repo

Why

Propagate `attributes` and `tags` from `variables.tf` to internal `label` module

28 Aug 18:09

Choose a tag to compare

Propagate attributes and tags from variables.tf to internal label module

0.1.3: Remove `template_name` (#5)

22 Aug 04:13

Choose a tag to compare

* Remove `template_name`

* Remove `template_name` and `var.settings`

0.1.2

20 Aug 20:13

Choose a tag to compare

Pin `tf_label` and `tf_hostname` to 0.1.0 (#4)

solution_stack_name-attribute

17 Aug 01:39

Choose a tag to compare

0.1.1

Add `solution_stack_name` attribute to `aws_elastic_beanstalk_environ…

0.1.0

09 Aug 18:46

Choose a tag to compare

Added config source envvar