diff --git a/cloudflare/resource_cloudflare_spectrum_application.go b/cloudflare/resource_cloudflare_spectrum_application.go index b107da64a6..27af623aba 100644 --- a/cloudflare/resource_cloudflare_spectrum_application.go +++ b/cloudflare/resource_cloudflare_spectrum_application.go @@ -33,6 +33,15 @@ func resourceCloudflareSpectrumApplication() *schema.Resource { Required: true, }, + "traffic_type": { + Type: schema.TypeString, + Default: "direct", + Optional: true, + ValidateFunc: validation.StringInSlice([]string{ + "direct", "http", "https", + }, false), + }, + "dns": { Type: schema.TypeList, Required: true, @@ -176,6 +185,7 @@ func resourceCloudflareSpectrumApplicationRead(d *schema.ResourceData, meta inte d.Set("origin_port", application.OriginPort) d.Set("tls", application.TLS) + d.Set("traffic_type", application.TrafficType) d.Set("ip_firewall", application.IPFirewall) d.Set("proxy_protocol", application.ProxyProtocol) @@ -273,6 +283,10 @@ func applicationFromResource(d *schema.ResourceData) cloudflare.SpectrumApplicat application.TLS = tls.(string) } + if traffic_type, ok := d.GetOk("traffic_type"); ok { + application.TrafficType = traffic_type.(string) + } + if ipFirewall, ok := d.GetOk("ip_firewall"); ok { application.IPFirewall = ipFirewall.(bool) } diff --git a/website/docs/r/spectrum_application.html.markdown b/website/docs/r/spectrum_application.html.markdown index c987f4f2f6..c4d1eec2c4 100644 --- a/website/docs/r/spectrum_application.html.markdown +++ b/website/docs/r/spectrum_application.html.markdown @@ -16,6 +16,7 @@ Provides a Cloudflare Spectrum Application. You can extend the power of Cloudfla # Define a spectrum application proxies ssh traffic resource "cloudflare_spectrum_application" "ssh_proxy" { protocol = "tcp/22" + traffic_type = "direct" dns = { type = "CNAME" name = "ssh.example.com" @@ -37,6 +38,7 @@ resource "cloudflare_spectrum_application" "ssh_proxy" { * `tls` - (Optional) TLS configuration option for Cloudflare to connect to your origin. Valid values are: `off`, `flexible`, `full` and `strict`. Defaults to `off`. * `ip_firewall` - (Optional) Enables the IP Firewall for this application. Defaults to `true`. * `proxy_protocol` - (Optional) Enables Proxy Protocol v1 to the origin. Defaults to `false`. +* `traffic_type` - (Optional) Set's application type. Valid values are: `direct`, `http`, `https`. Defaults to `direct`. **dns**