Code Monkey home page Code Monkey logo

Comments (4)

sysadmiral avatar sysadmiral commented on July 21, 2024

Please unpublish this from the registry until this is fixed?

from terraform-aws-elb.

antonbabenko avatar antonbabenko commented on July 21, 2024

Yes, this is a known limitation of Terraform. It does not support dynamically computed values in nested block structures. Read this comment - hashicorp/terraform#16582 (comment).

For the time being, I recommend using a static variable (${var...})or hard-coded values instead of using data-sources or resources.

@sysadmiral While this module has an issue (current bug) it is working properly in general, so it won't be unpublished from the registry.

from terraform-aws-elb.

robinbowes avatar robinbowes commented on July 21, 2024

I'm seeing the same issue when I try to use a variable in the listener block. The variable is passed into the containing module having been retrieved from a data block. eg. in main.tf of hte module piwik:

module "elb" {
  source = "terraform-aws-modules/elb/aws"

  name = "elb-${var.name}"

  subnets         = ["${var.elb_subnets}"]
  security_groups = ["${module.security.elb_security_group}"]
  internal        = false

  listener = [
    {
      instance_port     = "80"
      instance_protocol = "HTTP"
      lb_port           = "80"
      lb_protocol       = "HTTP"
    },
    {
      instance_port      = "80"
      instance_protocol  = "HTTP"
      lb_port            = "443"
      lb_protocol        = "HTTPS"
      ssl_certificate_id = "${var.ssl_certificate_id}"
    },
  ]

  health_check = [
    {
      target              = "HTTP:80/"
      interval            = 30
      healthy_threshold   = 2
      unhealthy_threshold = 2
      timeout             = 5
    },
  ]

  number_of_instances = 1
  instances           = ["${module.instance.id}"]

  tags = "${var.tags}"
}

I'm passing ssl_certificate_id into the module having retrieved it using a data source:

data "aws_acm_certificate" "app_cert" {
  domain = "${var.certificate_domain}"
}

module 'piwik' {
  source = "/path/to/module"
  ...
  ssl_certificate_id    = "${data.aws_acm_certificate.app_cert.arn}"
}

Is there no way to make this work?

R.

from terraform-aws-elb.

github-actions avatar github-actions commented on July 21, 2024

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

from terraform-aws-elb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.