Code Monkey home page Code Monkey logo

Comments (9)

antonbabenko avatar antonbabenko commented on August 22, 2024

How exactly does it fail? Show the error message.

from terraform-aws-elb.

yosefy avatar yosefy commented on August 22, 2024
  • module.elb_new.aws_elb.this: "listener.0.instance_port": required field is not set
  • module.elb_new.aws_elb.this: "listener.0.instance_protocol": required field is not set
  • module.elb_new.aws_elb.this: "listener.0.lb_port": required field is not set
  • module.elb_new.aws_elb.this: "listener.0.lb_protocol": required field is not set

from terraform-aws-elb.

yosefy avatar yosefy commented on August 22, 2024

when i remove the ssl_certificate_id
or add it as static string, all good

from terraform-aws-elb.

antonbabenko avatar antonbabenko commented on August 22, 2024

It looks like the issue is in Terraform - hashicorp/terraform-provider-aws#48 .

You need to make sure that you create aws_iam_server_certificate before passing its value to ssl_certificate_id. You need to avoid using calculated values (eg, data sources, resources, modules), because Terraform does not build dependency between aws_elb and ssl_certificate_id values.

This code will work:

  listener = [
    {
      instance_port     = "8020"
      instance_protocol = "HTTP"
      lb_port           = "443"
      lb_protocol       = "SSL"
      ssl_certificate_id = "arn:aws:iam::815361859851:server-certificate/terraform-test"
    },
  ]

as well as this:

  listener = [
    {
      instance_port     = "8020"
      instance_protocol = "HTTP"
      lb_port           = "443"
      lb_protocol       = "SSL"
      ssl_certificate_id = "${var.cert_arn}"
    },
  ]
# ...
}
variable "cert_arn" { default = "arn:aws:iam::815361859851:server-certificate/terraform-test" }

from terraform-aws-elb.

yosefy avatar yosefy commented on August 22, 2024

Anton, question:
i create the whole core (vpc, sgs, elbs, subnets) in one play
but then i can't do it anymore because i need the cert first...

do you have an idea how to mange this?

thanks

from terraform-aws-elb.

antonbabenko avatar antonbabenko commented on August 22, 2024

I would create a certificate during the first run. Create VPC and the rest in the second run. There are several things in Terraform like this, which can't be executed all-in-one. You can script this, of course.

from terraform-aws-elb.

gnydick avatar gnydick commented on August 22, 2024

@antonbabenko , are you saying it's impossible to create a monolithic config file for a service? By that I mean, all resources are generated and so we have no actual values for anything, like vpc_id?

from terraform-aws-elb.

antonbabenko avatar antonbabenko commented on August 22, 2024

@gnydick You can use a monolithic config file for a service and include data-sources in all non-complex arguments. listener has a complicated type map (or list of maps) and therefore computed values are not allowed there (limitation of Terraform).

from terraform-aws-elb.

github-actions avatar github-actions commented on August 22, 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.