ionoscloud_cdn_distribution
Creates and manages IonosCloud CDN Distributions.
Example Usage
resource "ionoscloud_cdn_distribution" "example" {
domain = "example.com"
certificate_id = ionoscloud_certificate.cert.id
routing_rules {
scheme = "https"
prefix = "/api"
upstream {
host = "server.example.com"
caching = true
waf = true
sni_mode = "distribution"
rate_limit_class = "R500"
geo_restrictions {
allow_list = [ "CN", "RU"]
}
}
}
routing_rules {
scheme = "http/https"
prefix = "/api2"
upstream {
host = "server2.example.com"
caching = false
waf = false
sni_mode = "origin"
rate_limit_class = "R10"
geo_restrictions {
block_list = [ "CN", "RU"]
}
}
}
}
#optionally you can add a certificate to the distribution
resource "ionoscloud_certificate" "cert" {
name = "add_name_here"
certificate = "${file("path_to_cert")}"
certificate_chain = "${file("path_to_cert_chain")}"
private_key = "${file("path_to_private_key")}"
}Argument Reference
Attributes Reference
Import
Last updated
