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

add early_hints to ssl settings schema #1286

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/1286.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/cloudflare_custom_hostname: add `settings.early_hints` to ssl schema
```
7 changes: 7 additions & 0 deletions cloudflare/resource_cloudflare_custom_hostname.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ func resourceCloudflareCustomHostname() *schema.Resource {
Type: schema.TypeString,
},
},
"early_hints": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{"on", "off"}, false),
},
},
},
},
Expand Down Expand Up @@ -174,6 +179,7 @@ func resourceCloudflareCustomHostnameRead(d *schema.ResourceData, meta interface
"tls13": customHostname.SSL.Settings.TLS13,
"min_tls_version": customHostname.SSL.Settings.MinTLSVersion,
"ciphers": customHostname.SSL.Settings.Ciphers,
"early_hints": customHostname.SSL.Settings.EarlyHints,
}},
})
}
Expand Down Expand Up @@ -284,6 +290,7 @@ func buildCustomHostname(d *schema.ResourceData) cloudflare.CustomHostname {
TLS13: d.Get("ssl.0.settings.0.tls13").(string),
MinTLSVersion: d.Get("ssl.0.settings.0.min_tls_version").(string),
Ciphers: expandInterfaceToStringList(d.Get("ssl.0.settings.0.ciphers").(*schema.Set).List()),
EarlyHints: d.Get("ssl.0.settings.0.early_hints").(string),
},
}
}
Expand Down
4 changes: 4 additions & 0 deletions cloudflare/resource_cloudflare_custom_hostname_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ resource "cloudflare_custom_hostname" "%[2]s" {
"ECDHE-RSA-AES128-GCM-SHA256",
"AES128-SHA"
]
early_hints = "off"
}
}
}
Expand All @@ -204,6 +205,7 @@ func TestAccCloudflareCustomHostnameUpdate(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "ssl.0.settings.0.http2", "off"),
resource.TestCheckResourceAttr(resourceName, "ssl.0.settings.0.min_tls_version", "1.2"),
resource.TestCheckResourceAttr(resourceName, "ssl.0.settings.0.ciphers.#", "2"),
resource.TestCheckResourceAttr(resourceName, "ssl.0.settings.0.early_hints", "off"),
),
},
{
Expand All @@ -214,6 +216,7 @@ func TestAccCloudflareCustomHostnameUpdate(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "ssl.0.settings.0.http2", "off"),
resource.TestCheckResourceAttr(resourceName, "ssl.0.settings.0.min_tls_version", "1.1"),
resource.TestCheckResourceAttr(resourceName, "ssl.0.settings.0.ciphers.#", "2"),
resource.TestCheckResourceAttr(resourceName, "ssl.0.settings.0.early_hints", "off"),
),
},
},
Expand All @@ -234,6 +237,7 @@ resource "cloudflare_custom_hostname" "%[2]s" {
"ECDHE-RSA-AES128-GCM-SHA256",
"AES128-SHA"
]
early_hints = "off"
}
}
}
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/custom_hostname.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ The following arguments are supported:
* `min_tls_version` - (Optional) Lowest version of TLS this certificate should
support. Valid values are `"1.0"`, `"1.1"`, `"1.2"` and `"1.3"`.
* `ciphers` - (Optional) List of SSL/TLS ciphers to associate with this certificate.
* `early_hints` - (Optional) Whether or not early hints should be supported. Valid values are `"on"` or `"off"`.

## Attributes Reference

Expand Down