https://discord.cloudflare.com logo
Join Discord
Powered by
# terraform-provider-cloudflare
  • u

    Unsmart | Tech debt

    05/09/2023, 2:32 PM
    I'm assuming for pages project it's not possible to use direct uploads? Only shows git stuff here
  • c

    Cyb3r-Jok3

    05/09/2023, 2:44 PM
    You should be able to managed direct upload projects via terraform. You can’t do a direct upload deployment via terraform though. That part has to be done externally
  • u

    Unsmart | Tech debt

    05/09/2023, 2:45 PM
    Ah I see interesting
  • c

    Cyb3r-Jok3

    05/09/2023, 2:46 PM
    There is a feature request to support direct uploads via terraform but that’s likely not going to happen as it would require the direct upload api being publicly documented
  • u

    Unsmart | Tech debt

    05/09/2023, 2:47 PM
    The workers one actually uploads the file though I assume since it has a content input?
  • c

    Cyb3r-Jok3

    05/09/2023, 2:56 PM
    Yeah workers has a documented way to upload code
  • r

    ryan

    05/11/2023, 5:22 PM
    Does the TF Provider currently have support for "Custom Nameservers" on zones? Im looking through the docs and feel dense; i don't see anything
  • c

    Cyb3r-Jok3

    05/11/2023, 9:32 PM
    I believe it is “vanity_nameservers” under the zone resource
  • r

    ryan

    05/11/2023, 10:00 PM
    That is read-only according to the documentation
  • c

    Cyb3r-Jok3

    05/11/2023, 10:07 PM
    Oh it is. Then I don't think it is possible to set with terraform. You should make an feature request on the repo for it
  • r

    ryan

    05/11/2023, 11:55 PM
    If it turns out to be something we need, I'll make a PR for the feature
  • i m not sure why they aren t the GitHub
    m

    Mike Eves

    05/12/2023, 8:33 AM
    Hey, did Hashicorp ever come back with anything useful or should I just assume the cloudflare provider won't be available from the hashicorp releases going forward?
    j
    • 2
    • 3
  • b

    b-fuze (Mike32)

    05/20/2023, 11:34 PM
    Is there any way to enable
    workers.dev
    subdomains for
    cloudflare_worker_script
    resources in the Terraform provider? After a lot of investigating it seems that it is not possible and I'd have to have throw something else together with the
    wrangler
    CLI somehow, but I just want confirm first
  • c

    Cyb3r-Jok3

    05/21/2023, 12:08 AM
    I don't believe there is a way with terraform. As far as I am aware the API for enabling/disabling the
    workers.dev
    route is not documented.
  • b

    b-fuze (Mike32)

    05/21/2023, 12:09 AM
    Okay, thanks. I'll just have to hack it with a Terraform
    external
    provider like I thought then 😓
  • c

    Cyb3r-Jok3

    05/21/2023, 12:10 AM
    Yeah wrangler and terraform don't play nice because they both want to be the source of truth
  • b

    b-fuze (Mike32)

    05/21/2023, 12:10 AM
    Yeah... Fingers crossed this will mostly work 😩
  • c

    cnk

    05/22/2023, 10:39 PM
    Does anyone have example code for using the cloudflare_rulesets data source for querying for an OWASP ruleset category? I am trying to replace
    Copy code
    categories {
              category = "attack-injection-php"
              enabled = false
            }
  • c

    cnk

    05/22/2023, 10:40 PM
    With a "skip" rule that does the same thing. I can create a rule where I list all the current "attack-injection-php" rules but that won't help me pick up any new rules that get added with that tag.
  • j

    jb

    05/23/2023, 12:04 AM
    none that come to mind but you could try looking at https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/internal/framework/service/rulesets/resource_test.go and searching for "skip"
  • m

    Matt

    05/25/2023, 1:31 AM
    howdy everybody! I was wondering if there was a roadmap for the provider? I'm looking to switch to terraform to deploy workers (using pulumi) but I'd need a way to specify the
    usage_model
    on worker scripts; and then looking further out, the ability to declare durable objects
  • c

    Cyb3r-Jok3

    05/25/2023, 1:40 AM
    There is an open issue on the terraform provider to add usage model (https://github.com/cloudflare/terraform-provider-cloudflare/issues/1205) however, durable objects would need to have a documented API before the process of adding it to the provider could be started.
  • c

    Cyb3r-Jok3

    05/25/2023, 1:41 AM
    Personally, for workers I would stick to wrangler and both wrangler and terraform will complete to be the source of truth
  • m

    Matt

    05/25/2023, 2:03 AM
    subscribed, thanks 🙂 I'm building a tool that generates a terraform stack dynamically in prod, so there's no opportunity in this pipeline to use a CLI (incl wrangler) I suppose I could wrap the wrangler CLI with an automation layer, and then build a custom terraform integration with the wrapper... but then I wonder if this is how the terraform provider should be built by default, given that "use wrangler to deploy" seems to be the officially-sanctioned guidance?
  • j

    jb

    05/25/2023, 2:13 AM
    wrangler is deeper integrated with the JS ecosystem and has things like bundling and service binding declarations in the wrangler config. terraform takes a deeper approach by maintaining the entire lifecycle of the resource. they are two different tools really.
  • j

    jb

    05/25/2023, 2:13 AM
    i.e. terraform doesn't have an inbuilt way of minifying and bundling. you need to do that yourself.
  • m

    Matt

    05/25/2023, 2:15 AM
    that's all good... I'd prefer to do a JS build outside of the deploy process so I can have finer control over the bundling/minifying/etc tooling (I also need to do this because I'm doing some crazy things with in-memory only modules via an esbuild plugin). I then create a bundle in memory and use pulumi to deploy it to cloudflare
  • m

    Matt

    05/25/2023, 2:17 AM
    it's working very well so I've been able to avoid wrangler CLI so far, except in 1 instance I did need a very small durable object so I used wrangler to deploy a new service + DO, and then I can access it from my terraform-managed resources via a service bindings (as terraform does not yet support DO bindings). I think this approach is adding a bit of latency because of the additional service-service hop, but that's okay for now
  • j

    jb

    05/25/2023, 3:36 AM
    fwiw, i use terraform in the same way. everything else is done outside of terraform and then the deploy process just picks up the file contents with any bindings, etc defined
  • Hi I am trying to use cf terraforming to
    b

    baconcheese

    05/26/2023, 6:56 AM
    Hi! I am trying to use cf-terraforming to generate some basics and no matter what i choose i get
    FATA[0000] --account and --zone are mutually exclusive, support for both is deprecated
    I've tried both with a token that has read on all resources and also the global key and email. Tried basics as shown in the wiki like
    generate --zone ZONE_ID --resource-type "cloudflare_record"
    and things that need the --account to no avail. Im not using zone and account together either so not sure why the error?
    c
    • 2
    • 2