Git Product home page Git Product logo

Comments (7)

msuterski avatar msuterski commented on August 15, 2024 2

We've solved it with a separate build step in our pipeline.

We're using gomplate and template the .tf files and put something like this in them

{{ $domains := (datasource "config").domains }}{{range $domains }}
  domain = { name = "{{.}}" }
{{- end}}

The steps would be something like

  1. /gomplate -f fastly.tf.tmpl -o fastly.tf -d config=config/dev.yml
  2. terraform plan ...

from terraform-provider-fastly.

msuterski avatar msuterski commented on August 15, 2024

this issue is a duplicate of https://github.com/terraform-providers/terraform-provider-fastly/issues/2

from terraform-provider-fastly.

wosc avatar wosc commented on August 15, 2024

The same problem (no count support) also applies to... basically all the fastly resources, AFAICT. Which is rather limiting, here are some use cases:

  • We want to not configure logging (bigquerylogging/gcslogging) for our staging system, but as I understand it, count is the only way to achieve an effect like if terraform.workspace == "production" with terraform.
    (For this concrete problem I'm going to try a workaround with a condition on the logging resource that always evaluates to false in staging, but that feels rather clumsy.)
  • We have three backend servers for our service, whose configuration (which is quite lengthy, with SSL certificates etc.) is exactly the same, except for the hostname. It would be nice if we didn't have to copy&paste all of it three times.

from terraform-provider-fastly.

chadgrant avatar chadgrant commented on August 15, 2024

why not just allow a csv value in for now until terraform properly supports count?

from terraform-provider-fastly.

samirspatel avatar samirspatel commented on August 15, 2024

We would really like for this to be implemented we we use a large list of domains and it is becoming very unwieldy to maintain

from terraform-provider-fastly.

matthope avatar matthope commented on August 15, 2024

Could you do something like...

  dynamic "domain" {
    for_each = var.domains
    content {
      name = "${domain.value}"
    }
  }

with

variable "domains" {
  type = list(string)
  default = [ "localhost" ]
}

?

from terraform-provider-fastly.

smaeda-ks avatar smaeda-ks commented on August 15, 2024

Yes, this shouldn't be a blocker these days. Please consider using dynamic blocks.
https://www.terraform.io/docs/language/expressions/dynamic-blocks.html

#2 (comment)

Closing this issue.

from terraform-provider-fastly.

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.