Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Application Type HTTP/HTTPS for Spectrum App #332

Closed
cehrig opened this issue May 5, 2019 · 10 comments
Closed

Support Application Type HTTP/HTTPS for Spectrum App #332

cehrig opened this issue May 5, 2019 · 10 comments

Comments

@cehrig
Copy link
Contributor

cehrig commented May 5, 2019

Hey there,

Using the Web UI we can create Spectrum Applications with Application Types HTTP or HTTPS. I don't manage to create a spectrum app with that setting using cloudflare_spectrum_application.

I can only create resources with protocol set to either udp or tcp. We need to programatically create spectrum apps using the HTTPS application type to go through the full CDN pipeline (including Page Rules, WAF, ...)

When creating a HTTPS Spectrum app using the Web UI, then using cf-terraforming to receive the resource configuration it shows:

resource "cloudflare_spectrum_application" "ID" {
    protocol = "tcp/443"
    dns = {
	type = "CNAME"
        name = "<cname>"
    }

    tls = "off"
    origin_direct = [ "<origin_direct>", ]
}

Trying to create a resource with the same settings using Terraform results in

Error: module.spectrum-443.cloudflare_spectrum_application.spectrum-application: "origin_port": required field is not set

Setting origin_port to 443 results in a Spectrum Application with Application Type "TCP"

@jacobbednarz
Copy link
Member

Looking at the public documentation (and testing with our Enterprise account) I'm not seeing HTTP/HTTPS anywhere so it must be another level which we don't have access to. Are you able to open a support ticket with Cloudflare Support to get the public documentation updated to match? We generally don't add functionality unless it's explicitly called out publicly somewhere to avoid building on top of unstable APIs.

@cehrig
Copy link
Contributor Author

cehrig commented May 5, 2019

@jacobbednarz thanks for getting back. For clarification, I am talking about the dropdown as shown in the screenshot
2019-05-05_23-57

I am going to get in touch with CF support and update the issue.

@jacobbednarz
Copy link
Member

That's great, thank you. Once we have that in place, I'm 👍 for adding to the provider to support this.

@cehrig
Copy link
Contributor Author

cehrig commented May 16, 2019

I got the Info from Cloudflare, that HTTP/HTTPS Spectrum applications are not yet GA, so changes to the API will probably take some time. Let me know if we should keep the issue open or if I should open a new one as soon as the feature is available.

Cheers,
Christian

@jacobbednarz
Copy link
Member

I’m happy to leave this open as to do item but just be aware we generally don’t add functionality until it’s publicly documented. This ensures we are only building against intended APIs and they are supported for public use and won’t change unknowingly beneath us.

@jacobbednarz
Copy link
Member

fixed in #481

@f33rx
Copy link

f33rx commented Oct 21, 2019

This does not seem to be fixed using Version 2.0; I am getting an error on key traffic_type as defined https://github.com/terraform-providers/terraform-provider-cloudflare/blob/master/vendor/github.com/cloudflare/cloudflare-go/spectrum.go#L23 and https://github.com/terraform-providers/terraform-provider-cloudflare/blob/master/cloudflare/resource_cloudflare_spectrum_application.go#L36

resource "cloudflare_spectrum_application" "https_proxy" {
  zone_id      = var.zoneId
  protocol     = "tcp/443"
  traffic_type = https
  dns {
    type = "CNAME"
    name = "foo.example.com"
  }

  origin_port = "443"
  tls         = "full"
  ip_firewall = true

  origin_direct = [
    "tcp://${address.lb-ext.address}:443"
  ]
}

Presents the error:

Error: Unsupported argument

  on cloudflare-spectrum.tf line 37, in resource "cloudflare_spectrum_application" "https_proxy":
  37:   traffic_type = https

An argument named "traffic_type" is not expected here.

*** [plan] Error 1

Additionally, the ivp4 key does not seem to be available either for setting "Edge IP Connectivity
" in the TF Provider: https://github.com/terraform-providers/terraform-provider-cloudflare/blob/master/vendor/github.com/cloudflare/cloudflare-go/spectrum.go#L15

Entirely possible I'm holding something wrong. The provider definition is as such:

provider "cloudflare" {
  account_id = var.accountId
  api_token = var.cloudflareApiToken
  version = "~> 2.0"
}

@jacobbednarz
Copy link
Member

Are you building the provider locally? The functionality referenced here hasn't been cut in a release yet.

@f33rx
Copy link

f33rx commented Oct 24, 2019

Are you building the provider locally? The functionality referenced here hasn't been cut in a release yet.

No, I am not. That would explain it, ha, thanks! Bit of a derpy reply on my part, apologies!

@jacobbednarz
Copy link
Member

2.0.1 was cut yesterday so updating your provider will work out of the box now.

boekkooi-lengoo pushed a commit to boekkooi-lengoo/terraform-provider-cloudflare that referenced this issue Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants