diff --git a/docs/resources/cdn_resource.md b/docs/resources/cdn_resource.md
index e75a8a85..9ca6c652 100644
--- a/docs/resources/cdn_resource.md
+++ b/docs/resources/cdn_resource.md
@@ -91,23 +91,70 @@ resource "edgecenter_cdn_resource" "cdn_example_com" {
Optional:
+- `allowed_http_methods` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--allowed_http_methods))
+- `brotli_compression` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--brotli_compression))
- `browser_cache_settings` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--browser_cache_settings))
+- `cache_http_headers` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--cache_http_headers))
- `cors` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--cors))
+- `country_acl` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--country_acl))
+- `disable_proxy_force_ranges` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--disable_proxy_force_ranges))
- `edge_cache_settings` (Block List, Max: 1) The cache expiration time for CDN servers. (see [below for nested schema](#nestedblock--options--edge_cache_settings))
+- `fetch_compressed` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--fetch_compressed))
+- `follow_origin_redirect` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--follow_origin_redirect))
+- `force_return` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--force_return))
+- `forward_host_header` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--forward_host_header))
- `gzip_on` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--gzip_on))
- `host_header` (Block List, Max: 1) Specify the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header. If the option is in NULL state Host Header value is taken from the CNAME field. (see [below for nested schema](#nestedblock--options--host_header))
+- `http3_enabled` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--http3_enabled))
+- `ignore_cookie` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--ignore_cookie))
- `ignore_query_string` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--ignore_query_string))
+- `image_stack` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--image_stack))
+- `ip_address_acl` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--ip_address_acl))
+- `limit_bandwidth` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--limit_bandwidth))
+- `proxy_cache_methods_set` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--proxy_cache_methods_set))
- `query_params_blacklist` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--query_params_blacklist))
- `query_params_whitelist` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--query_params_whitelist))
- `redirect_http_to_https` (Block List, Max: 1) Sets redirect from HTTP protocol to HTTPS for all resource requests. (see [below for nested schema](#nestedblock--options--redirect_http_to_https))
+- `redirect_https_to_http` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--redirect_https_to_http))
+- `referrer_acl` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--referrer_acl))
+- `response_headers_hiding_policy` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--response_headers_hiding_policy))
- `rewrite` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--rewrite))
+- `secure_key` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--secure_key))
+- `slice` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--slice))
- `sni` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--sni))
-- `static_headers` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--static_headers))
+- `stale` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--stale))
+- `static_headers` (Block List, Max: 1) Option has been deprecated. Use - static_response_headers. (see [below for nested schema](#nestedblock--options--static_headers))
- `static_request_headers` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--static_request_headers))
+- `static_response_headers` (Block List, Max: 1) Specify custom HTTP Headers that a CDN server adds to a response. (see [below for nested schema](#nestedblock--options--static_response_headers))
- `tls_versions` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--tls_versions))
-- `webp` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--webp))
+- `use_default_le_chain` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--use_default_le_chain))
+- `user_agent_acl` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--user_agent_acl))
- `websockets` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--websockets))
+
+### Nested Schema for `options.allowed_http_methods`
+
+Required:
+
+- `value` (Set of String)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.brotli_compression`
+
+Required:
+
+- `value` (Set of String)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.browser_cache_settings`
@@ -117,6 +164,18 @@ Optional:
- `value` (String)
+
+### Nested Schema for `options.cache_http_headers`
+
+Required:
+
+- `value` (Set of String)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.cors`
@@ -126,6 +185,32 @@ Required:
Optional:
+- `always` (Boolean)
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.country_acl`
+
+Required:
+
+- `excepted_values` (Set of String)
+- `policy_type` (String)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.disable_proxy_force_ranges`
+
+Required:
+
+- `value` (Boolean)
+
+Optional:
+
- `enabled` (Boolean)
@@ -140,6 +225,55 @@ Optional:
- `value` (String) Caching time for a response with codes 200, 206, 301, 302. Responses with codes 4xx, 5xx will not be cached. Use '0s' disable to caching. Use custom_values field to specify a custom caching time for a response with specific codes.
+
+### Nested Schema for `options.fetch_compressed`
+
+Required:
+
+- `value` (Boolean)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.follow_origin_redirect`
+
+Required:
+
+- `codes` (Set of Number)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.force_return`
+
+Required:
+
+- `code` (Number)
+
+Optional:
+
+- `body` (String)
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.forward_host_header`
+
+Required:
+
+- `value` (Boolean)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.gzip_on`
@@ -164,6 +298,30 @@ Optional:
- `enabled` (Boolean)
+
+### Nested Schema for `options.http3_enabled`
+
+Required:
+
+- `value` (Boolean)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.ignore_cookie`
+
+Required:
+
+- `value` (Boolean)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.ignore_query_string`
@@ -176,6 +334,60 @@ Optional:
- `enabled` (Boolean)
+
+### Nested Schema for `options.image_stack`
+
+Required:
+
+- `quality` (Number)
+
+Optional:
+
+- `avif_enabled` (Boolean)
+- `enabled` (Boolean)
+- `png_lossless` (Boolean)
+- `webp_enabled` (Boolean)
+
+
+
+### Nested Schema for `options.ip_address_acl`
+
+Required:
+
+- `excepted_values` (Set of String)
+- `policy_type` (String)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.limit_bandwidth`
+
+Required:
+
+- `limit_type` (String)
+
+Optional:
+
+- `buffer` (Number)
+- `enabled` (Boolean)
+- `speed` (Number)
+
+
+
+### Nested Schema for `options.proxy_cache_methods_set`
+
+Required:
+
+- `value` (Boolean)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.query_params_blacklist`
@@ -212,6 +424,44 @@ Optional:
- `enabled` (Boolean)
+
+### Nested Schema for `options.redirect_https_to_http`
+
+Required:
+
+- `value` (Boolean)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.referrer_acl`
+
+Required:
+
+- `excepted_values` (Set of String)
+- `policy_type` (String) Possible values: allow, deny.
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.response_headers_hiding_policy`
+
+Required:
+
+- `excepted` (Set of String)
+- `mode` (String)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.rewrite`
@@ -225,6 +475,31 @@ Optional:
- `flag` (String)
+
+### Nested Schema for `options.secure_key`
+
+Required:
+
+- `key` (String)
+- `type` (Number)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.slice`
+
+Required:
+
+- `value` (Boolean)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.sni`
@@ -235,6 +510,18 @@ Optional:
- `sni_type` (String) Available values 'dynamic' or 'custom'
+
+### Nested Schema for `options.stale`
+
+Required:
+
+- `value` (Set of String)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.static_headers`
@@ -259,6 +546,31 @@ Optional:
- `enabled` (Boolean)
+
+### Nested Schema for `options.static_response_headers`
+
+Required:
+
+- `value` (Block List, Min: 1) (see [below for nested schema](#nestedblock--options--static_response_headers--value))
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+### Nested Schema for `options.static_response_headers.value`
+
+Required:
+
+- `name` (String)
+- `value` (Set of String)
+
+Optional:
+
+- `always` (Boolean)
+
+
+
### Nested Schema for `options.tls_versions`
@@ -271,18 +583,29 @@ Optional:
- `enabled` (Boolean)
-
-### Nested Schema for `options.webp`
+
+### Nested Schema for `options.use_default_le_chain`
Required:
-- `jpg_quality` (Number)
-- `png_quality` (Number)
+- `value` (Boolean)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.user_agent_acl`
+
+Required:
+
+- `excepted_values` (Set of String)
+- `policy_type` (String)
Optional:
- `enabled` (Boolean)
-- `png_lossless` (Boolean)
diff --git a/docs/resources/cdn_rule.md b/docs/resources/cdn_rule.md
index ba6b7054..3c1422bc 100644
--- a/docs/resources/cdn_rule.md
+++ b/docs/resources/cdn_rule.md
@@ -21,7 +21,6 @@ resource "edgecenter_cdn_rule" "cdn_example_com_rule_1" {
resource_id = edgecenter_cdn_resource.cdn_example_com.id
name = "All PNG images"
rule = "/folder/images/*.png"
- rule_type = 0
options {
edge_cache_settings {
@@ -58,7 +57,6 @@ resource "edgecenter_cdn_rule" "cdn_example_com_rule_2" {
resource_id = edgecenter_cdn_resource.cdn_example_com.id
name = "All JS scripts"
rule = "/folder/images/*.js"
- rule_type = 0
origin_protocol = "HTTP"
options {
@@ -103,13 +101,14 @@ resource "edgecenter_cdn_resource" "cdn_example_com" {
- `name` (String) Rule name
- `resource_id` (Number)
- `rule` (String) A pattern that defines when the rule is triggered. By default, we add a leading forward slash to any rule pattern. Specify a pattern without a forward slash.
-- `rule_type` (Number) Type of rule. The rule is applied if the requested URI matches the rule pattern. It has two possible values: Type 0 — RegEx. Must start with '^/' or '/'. Type 1 — RegEx. Legacy type. Note that for this rule type we automatically add / to each rule pattern before your regular expression. Please use Type 0.
### Optional
+- `active` (Boolean) Shows if the location is enabled.
- `options` (Block List, Max: 1) Each option in CDN resource settings. Each option added to CDN resource settings should have the following mandatory request fields: enabled, value. (see [below for nested schema](#nestedblock--options))
- `origin_group` (Number) ID of the Origins Group. Use one of your Origins Group or create a new one. You can use either 'origin' parameter or 'originGroup' in the resource definition.
- `origin_protocol` (String) This option defines the protocol that will be used by CDN servers to request content from an origin source. If not specified, it will be inherit from resource. Possible values are: HTTPS, HTTP, MATCH.
+- `weight` (Number)
### Read-Only
@@ -120,23 +119,67 @@ resource "edgecenter_cdn_resource" "cdn_example_com" {
Optional:
+- `allowed_http_methods` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--allowed_http_methods))
+- `brotli_compression` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--brotli_compression))
- `browser_cache_settings` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--browser_cache_settings))
+- `cache_http_headers` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--cache_http_headers))
- `cors` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--cors))
+- `country_acl` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--country_acl))
+- `disable_proxy_force_ranges` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--disable_proxy_force_ranges))
- `edge_cache_settings` (Block List, Max: 1) The cache expiration time for CDN servers. (see [below for nested schema](#nestedblock--options--edge_cache_settings))
+- `fetch_compressed` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--fetch_compressed))
+- `follow_origin_redirect` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--follow_origin_redirect))
+- `force_return` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--force_return))
+- `forward_host_header` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--forward_host_header))
- `gzip_on` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--gzip_on))
- `host_header` (Block List, Max: 1) Specify the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header. If the option is in NULL state Host Header value is taken from the CNAME field. (see [below for nested schema](#nestedblock--options--host_header))
+- `ignore_cookie` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--ignore_cookie))
- `ignore_query_string` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--ignore_query_string))
+- `image_stack` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--image_stack))
+- `ip_address_acl` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--ip_address_acl))
+- `limit_bandwidth` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--limit_bandwidth))
+- `proxy_cache_methods_set` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--proxy_cache_methods_set))
- `query_params_blacklist` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--query_params_blacklist))
- `query_params_whitelist` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--query_params_whitelist))
- `redirect_http_to_https` (Block List, Max: 1) Sets redirect from HTTP protocol to HTTPS for all resource requests. (see [below for nested schema](#nestedblock--options--redirect_http_to_https))
+- `redirect_https_to_http` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--redirect_https_to_http))
+- `referrer_acl` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--referrer_acl))
+- `response_headers_hiding_policy` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--response_headers_hiding_policy))
- `rewrite` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--rewrite))
+- `secure_key` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--secure_key))
+- `slice` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--slice))
- `sni` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--sni))
-- `static_headers` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--static_headers))
+- `stale` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--stale))
+- `static_headers` (Block List, Max: 1) Option has been deprecated. Use - static_response_headers. (see [below for nested schema](#nestedblock--options--static_headers))
- `static_request_headers` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--static_request_headers))
-- `tls_versions` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--tls_versions))
-- `webp` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--webp))
+- `static_response_headers` (Block List, Max: 1) Specify custom HTTP Headers that a CDN server adds to a response. (see [below for nested schema](#nestedblock--options--static_response_headers))
+- `user_agent_acl` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--user_agent_acl))
- `websockets` (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--websockets))
+
+### Nested Schema for `options.allowed_http_methods`
+
+Required:
+
+- `value` (Set of String)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.brotli_compression`
+
+Required:
+
+- `value` (Set of String)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.browser_cache_settings`
@@ -146,6 +189,18 @@ Optional:
- `value` (String)
+
+### Nested Schema for `options.cache_http_headers`
+
+Required:
+
+- `value` (Set of String)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.cors`
@@ -155,6 +210,32 @@ Required:
Optional:
+- `always` (Boolean)
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.country_acl`
+
+Required:
+
+- `excepted_values` (Set of String)
+- `policy_type` (String)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.disable_proxy_force_ranges`
+
+Required:
+
+- `value` (Boolean)
+
+Optional:
+
- `enabled` (Boolean)
@@ -169,6 +250,55 @@ Optional:
- `value` (String) Caching time for a response with codes 200, 206, 301, 302. Responses with codes 4xx, 5xx will not be cached. Use '0s' disable to caching. Use custom_values field to specify a custom caching time for a response with specific codes.
+
+### Nested Schema for `options.fetch_compressed`
+
+Required:
+
+- `value` (Boolean)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.follow_origin_redirect`
+
+Required:
+
+- `codes` (Set of Number)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.force_return`
+
+Required:
+
+- `code` (Number)
+
+Optional:
+
+- `body` (String)
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.forward_host_header`
+
+Required:
+
+- `value` (Boolean)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.gzip_on`
@@ -193,6 +323,18 @@ Optional:
- `enabled` (Boolean)
+
+### Nested Schema for `options.ignore_cookie`
+
+Required:
+
+- `value` (Boolean)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.ignore_query_string`
@@ -205,6 +347,60 @@ Optional:
- `enabled` (Boolean)
+
+### Nested Schema for `options.image_stack`
+
+Required:
+
+- `quality` (Number)
+
+Optional:
+
+- `avif_enabled` (Boolean)
+- `enabled` (Boolean)
+- `png_lossless` (Boolean)
+- `webp_enabled` (Boolean)
+
+
+
+### Nested Schema for `options.ip_address_acl`
+
+Required:
+
+- `excepted_values` (Set of String)
+- `policy_type` (String)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.limit_bandwidth`
+
+Required:
+
+- `limit_type` (String)
+
+Optional:
+
+- `buffer` (Number)
+- `enabled` (Boolean)
+- `speed` (Number)
+
+
+
+### Nested Schema for `options.proxy_cache_methods_set`
+
+Required:
+
+- `value` (Boolean)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.query_params_blacklist`
@@ -241,6 +437,44 @@ Optional:
- `enabled` (Boolean)
+
+### Nested Schema for `options.redirect_https_to_http`
+
+Required:
+
+- `value` (Boolean)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.referrer_acl`
+
+Required:
+
+- `excepted_values` (Set of String)
+- `policy_type` (String) Possible values: allow, deny.
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.response_headers_hiding_policy`
+
+Required:
+
+- `excepted` (Set of String)
+- `mode` (String)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.rewrite`
@@ -254,6 +488,31 @@ Optional:
- `flag` (String)
+
+### Nested Schema for `options.secure_key`
+
+Required:
+
+- `key` (String)
+- `type` (Number)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
+
+### Nested Schema for `options.slice`
+
+Required:
+
+- `value` (Boolean)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.sni`
@@ -264,6 +523,18 @@ Optional:
- `sni_type` (String) Available values 'dynamic' or 'custom'
+
+### Nested Schema for `options.stale`
+
+Required:
+
+- `value` (Set of String)
+
+Optional:
+
+- `enabled` (Boolean)
+
+
### Nested Schema for `options.static_headers`
@@ -288,30 +559,42 @@ Optional:
- `enabled` (Boolean)
-
-### Nested Schema for `options.tls_versions`
+
+### Nested Schema for `options.static_response_headers`
Required:
-- `value` (Set of String)
+- `value` (Block List, Min: 1) (see [below for nested schema](#nestedblock--options--static_response_headers--value))
Optional:
- `enabled` (Boolean)
+
+### Nested Schema for `options.static_response_headers.value`
+
+Required:
+
+- `name` (String)
+- `value` (Set of String)
+
+Optional:
+
+- `always` (Boolean)
-
-### Nested Schema for `options.webp`
+
+
+
+### Nested Schema for `options.user_agent_acl`
Required:
-- `jpg_quality` (Number)
-- `png_quality` (Number)
+- `excepted_values` (Set of String)
+- `policy_type` (String)
Optional:
- `enabled` (Boolean)
-- `png_lossless` (Boolean)
diff --git a/docs/resources/floatingip.md b/docs/resources/floatingip.md
index 1104fc77..70ec4093 100644
--- a/docs/resources/floatingip.md
+++ b/docs/resources/floatingip.md
@@ -37,6 +37,7 @@ resource "edgecenter_floatingip" "floating_ip" {
- `fixed_ip_address` (String) The fixed (reserved) IP address that is associated with the floating IP.
- `last_updated` (String) The timestamp of the last update (use with update context).
+- `metadata_map` (Map of String) A map containing metadata, for example tags.
- `port_id` (String) The ID (uuid) of the network port that the floating IP is associated with.
- `project_id` (Number) The uuid of the project. Either 'project_id' or 'project_name' must be specified.
- `project_name` (String) The name of the project. Either 'project_id' or 'project_name' must be specified.
diff --git a/edgecenter/resource_edgecenter_cdn_resource.go b/edgecenter/resource_edgecenter_cdn_resource.go
index 77c56167..da8633df 100644
--- a/edgecenter/resource_edgecenter_cdn_resource.go
+++ b/edgecenter/resource_edgecenter_cdn_resource.go
@@ -14,7 +14,7 @@ import (
"github.com/Edge-Center/edgecentercdn-go/resources"
)
-var optionsSchema = &schema.Schema{
+var resourceOptionsSchema = &schema.Schema{
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
@@ -22,6 +22,164 @@ var optionsSchema = &schema.Schema{
Description: "Each option in CDN resource settings. Each option added to CDN resource settings should have the following mandatory request fields: enabled, value.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
+ "allowed_http_methods": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "brotli_compression": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "browser_cache_settings": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "cache_http_headers": { // Deprecated. Use - response_headers_hiding_policy.
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "cors": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ "always": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "country_acl": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "policy_type": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "excepted_values": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "disable_proxy_force_ranges": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
"edge_cache_settings": {
Type: schema.TypeList,
MaxItems: 1,
@@ -58,11 +216,10 @@ var optionsSchema = &schema.Schema{
},
},
},
- "browser_cache_settings": {
+ "fetch_compressed": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
- Computed: true,
Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
@@ -72,13 +229,97 @@ var optionsSchema = &schema.Schema{
Default: true,
},
"value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
+ "follow_origin_redirect": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "codes": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeInt},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "force_return": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "code": {
+ Type: schema.TypeInt,
+ Required: true,
+ Description: "",
+ },
+ "body": {
Type: schema.TypeString,
Optional: true,
+ Default: "",
Description: "",
},
},
},
},
+ "forward_host_header": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
+ "gzip_on": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
"host_header": {
Type: schema.TypeList,
MaxItems: 1,
@@ -98,11 +339,11 @@ var optionsSchema = &schema.Schema{
},
},
},
- "redirect_http_to_https": {
+ "http3_enabled": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
- Description: "Sets redirect from HTTP protocol to HTTPS for all resource requests.",
+ Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"enabled": {
@@ -117,7 +358,7 @@ var optionsSchema = &schema.Schema{
},
},
},
- "gzip_on": {
+ "ignore_cookie": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
@@ -136,7 +377,141 @@ var optionsSchema = &schema.Schema{
},
},
},
- "cors": {
+ "ignore_query_string": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
+ "image_stack": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "avif_enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ },
+ "webp_enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ },
+ "quality": {
+ Type: schema.TypeInt,
+ Required: true,
+ Description: "",
+ },
+ "png_lossless": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "ip_address_acl": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "policy_type": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "excepted_values": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "limit_bandwidth": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "limit_type": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "speed": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ },
+ "buffer": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "proxy_cache_methods_set": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
+ "query_params_blacklist": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
@@ -156,7 +531,7 @@ var optionsSchema = &schema.Schema{
},
},
},
- "rewrite": {
+ "query_params_whitelist": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
@@ -168,19 +543,34 @@ var optionsSchema = &schema.Schema{
Optional: true,
Default: true,
},
- "body": {
- Type: schema.TypeString,
+ "value": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
Required: true,
},
- "flag": {
- Type: schema.TypeString,
+ },
+ },
+ },
+ "redirect_http_to_https": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "Sets redirect from HTTP protocol to HTTPS for all resource requests.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
Optional: true,
- Default: "break",
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
},
},
},
},
- "webp": {
+ "redirect_https_to_http": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
@@ -192,18 +582,131 @@ var optionsSchema = &schema.Schema{
Optional: true,
Default: true,
},
- "jpg_quality": {
- Type: schema.TypeInt,
+ "value": {
+ Type: schema.TypeBool,
Required: true,
},
- "png_quality": {
- Type: schema.TypeInt,
- Required: true,
+ },
+ },
+ },
+ "referrer_acl": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
},
- "png_lossless": {
+ "policy_type": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "Possible values: allow, deny.",
+ },
+ "excepted_values": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "response_headers_hiding_policy": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
Type: schema.TypeBool,
Optional: true,
- Default: false,
+ Default: true,
+ },
+ "mode": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "excepted": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "rewrite": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "body": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "flag": {
+ Type: schema.TypeString,
+ Optional: true,
+ Default: "break",
+ Description: "",
+ },
+ },
+ },
+ },
+ "secure_key": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "key": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "type": {
+ Type: schema.TypeInt,
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "slice": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
},
},
},
@@ -234,10 +737,11 @@ var optionsSchema = &schema.Schema{
},
},
},
- "ignore_query_string": {
+ "stale": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
+ Computed: true,
Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
@@ -247,17 +751,19 @@ var optionsSchema = &schema.Schema{
Default: true,
},
"value": {
- Type: schema.TypeBool,
- Required: true,
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
},
},
},
},
- "query_params_whitelist": {
+ "static_headers": { // Deprecated. Use - static_response_headers.
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
- Description: "",
+ Description: "Option has been deprecated. Use - static_response_headers.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"enabled": {
@@ -266,14 +772,14 @@ var optionsSchema = &schema.Schema{
Default: true,
},
"value": {
- Type: schema.TypeSet,
+ Type: schema.TypeMap,
Elem: &schema.Schema{Type: schema.TypeString},
Required: true,
},
},
},
},
- "query_params_blacklist": {
+ "static_request_headers": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
@@ -286,18 +792,19 @@ var optionsSchema = &schema.Schema{
Default: true,
},
"value": {
- Type: schema.TypeSet,
- Elem: &schema.Schema{Type: schema.TypeString},
- Required: true,
+ Type: schema.TypeMap,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
},
},
},
},
- "static_request_headers": {
+ "static_response_headers": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
- Description: "",
+ Description: "Specify custom HTTP Headers that a CDN server adds to a response.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"enabled": {
@@ -306,14 +813,34 @@ var optionsSchema = &schema.Schema{
Default: true,
},
"value": {
- Type: schema.TypeMap,
- Elem: &schema.Schema{Type: schema.TypeString},
+ Type: schema.TypeList,
Required: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "value": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ "always": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ },
+ },
+ },
},
},
},
},
- "static_headers": {
+ "tls_versions": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
@@ -326,14 +853,15 @@ var optionsSchema = &schema.Schema{
Default: true,
},
"value": {
- Type: schema.TypeMap,
- Elem: &schema.Schema{Type: schema.TypeString},
- Required: true,
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
},
},
},
},
- "websockets": {
+ "use_default_le_chain": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
@@ -352,7 +880,33 @@ var optionsSchema = &schema.Schema{
},
},
},
- "tls_versions": {
+ "user_agent_acl": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "policy_type": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "excepted_values": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "websockets": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
@@ -365,8 +919,7 @@ var optionsSchema = &schema.Schema{
Default: true,
},
"value": {
- Type: schema.TypeSet,
- Elem: &schema.Schema{Type: schema.TypeString},
+ Type: schema.TypeBool,
Required: true,
},
},
@@ -462,7 +1015,7 @@ func resourceCDNResource() *schema.Resource {
Computed: true,
Description: "Status of a CDN resource content availability. Possible values are: Active, Suspended, Processed.",
},
- "options": optionsSchema,
+ "options": resourceOptionsSchema,
},
CreateContext: resourceCDNResourceCreate,
ReadContext: resourceCDNResourceRead,
@@ -491,7 +1044,7 @@ func resourceCDNResourceCreate(ctx context.Context, d *schema.ResourceData, m in
req.IssueLECert = d.Get("issue_le_cert").(bool)
}
- req.Options = listToOptions(d.Get("options").([]interface{}))
+ req.Options = listToResourceOptions(d.Get("options").([]interface{}))
for _, hostname := range d.Get("secondary_hostnames").(*schema.Set).List() {
req.SecondaryHostnames = append(req.SecondaryHostnames, hostname.(string))
@@ -536,7 +1089,7 @@ func resourceCDNResourceRead(ctx context.Context, d *schema.ResourceData, m inte
d.Set("ssl_automated", result.SSLAutomated)
d.Set("status", result.Status)
d.Set("active", result.Active)
- if err := d.Set("options", optionsToList(result.Options)); err != nil {
+ if err := d.Set("options", resourceOptionsToList(result.Options)); err != nil {
return diag.FromErr(err)
}
@@ -563,7 +1116,7 @@ func resourceCDNResourceUpdate(ctx context.Context, d *schema.ResourceData, m in
req.SSlEnabled = d.Get("ssl_enabled").(bool)
req.SSLData = d.Get("ssl_data").(int)
req.OriginProtocol = resources.Protocol(d.Get("origin_protocol").(string))
- req.Options = listToOptions(d.Get("options").([]interface{}))
+ req.Options = listToResourceOptions(d.Get("options").([]interface{}))
for _, hostname := range d.Get("secondary_hostnames").(*schema.Set).List() {
req.SecondaryHostnames = append(req.SecondaryHostnames, hostname.(string))
}
@@ -598,13 +1151,69 @@ func resourceCDNResourceDelete(ctx context.Context, d *schema.ResourceData, m in
return nil
}
-func listToOptions(l []interface{}) *cdn.Options {
+func listToResourceOptions(l []interface{}) *cdn.ResourceOptions {
if len(l) == 0 {
return nil
}
- var opts cdn.Options
+ var opts cdn.ResourceOptions
fields := l[0].(map[string]interface{})
+ if opt, ok := getOptByName(fields, "allowed_http_methods"); ok {
+ opts.AllowedHTTPMethods = &cdn.AllowedHTTPMethods{
+ Enabled: opt["enabled"].(bool),
+ }
+ for _, v := range opt["value"].(*schema.Set).List() {
+ opts.AllowedHTTPMethods.Value = append(opts.AllowedHTTPMethods.Value, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "brotli_compression"); ok {
+ opts.BrotliCompression = &cdn.BrotliCompression{
+ Enabled: opt["enabled"].(bool),
+ }
+ for _, v := range opt["value"].(*schema.Set).List() {
+ opts.BrotliCompression.Value = append(opts.BrotliCompression.Value, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "browser_cache_settings"); ok {
+ opts.BrowserCacheSettings = &cdn.BrowserCacheSettings{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(string),
+ }
+ }
+ if opt, ok := getOptByName(fields, "cache_http_headers"); ok {
+ opts.CacheHttpHeaders = &cdn.CacheHttpHeaders{
+ Enabled: opt["enabled"].(bool),
+ }
+ for _, v := range opt["value"].(*schema.Set).List() {
+ opts.CacheHttpHeaders.Value = append(opts.CacheHttpHeaders.Value, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "cors"); ok {
+ opts.Cors = &cdn.Cors{
+ Enabled: opt["enabled"].(bool),
+ }
+ for _, v := range opt["value"].(*schema.Set).List() {
+ opts.Cors.Value = append(opts.Cors.Value, v.(string))
+ }
+ if _, ok := opt["always"]; ok {
+ opts.Cors.Always = opt["always"].(bool)
+ }
+ }
+ if opt, ok := getOptByName(fields, "country_acl"); ok {
+ opts.CountryACL = &cdn.CountryACL{
+ Enabled: opt["enabled"].(bool),
+ PolicyType: opt["policy_type"].(string),
+ }
+ for _, v := range opt["excepted_values"].(*schema.Set).List() {
+ opts.CountryACL.ExceptedValues = append(opts.CountryACL.ExceptedValues, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "disable_proxy_force_ranges"); ok {
+ opts.DisableProxyForceRanges = &cdn.DisableProxyForceRanges{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
if opt, ok := getOptByName(fields, "edge_cache_settings"); ok {
rawCustomVals := opt["custom_values"].(map[string]interface{})
customVals := make(map[string]string, len(rawCustomVals))
@@ -619,14 +1228,37 @@ func listToOptions(l []interface{}) *cdn.Options {
Default: opt["default"].(string),
}
}
- if opt, ok := getOptByName(fields, "browser_cache_settings"); ok {
- enabled := true
- if _, ok := opt["enabled"]; ok {
- enabled = opt["enabled"].(bool)
+ if opt, ok := getOptByName(fields, "fetch_compressed"); ok {
+ opts.FetchCompressed = &cdn.FetchCompressed{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
}
- opts.BrowserCacheSettings = &cdn.BrowserCacheSettings{
- Enabled: enabled,
- Value: opt["value"].(string),
+ }
+ if opt, ok := getOptByName(fields, "follow_origin_redirect"); ok {
+ opts.FollowOriginRedirect = &cdn.FollowOriginRedirect{
+ Enabled: opt["enabled"].(bool),
+ }
+ for _, v := range opt["codes"].(*schema.Set).List() {
+ opts.FollowOriginRedirect.Codes = append(opts.FollowOriginRedirect.Codes, v.(int))
+ }
+ }
+ if opt, ok := getOptByName(fields, "force_return"); ok {
+ opts.ForceReturn = &cdn.ForceReturn{
+ Enabled: opt["enabled"].(bool),
+ Code: opt["code"].(int),
+ Body: opt["body"].(string),
+ }
+ }
+ if opt, ok := getOptByName(fields, "forward_host_header"); ok {
+ opts.ForwardHostHeader = &cdn.ForwardHostHeader{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
+ if opt, ok := getOptByName(fields, "gzip_on"); ok {
+ opts.GzipOn = &cdn.GzipOn{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
}
}
if opt, ok := getOptByName(fields, "host_header"); ok {
@@ -635,154 +1267,212 @@ func listToOptions(l []interface{}) *cdn.Options {
Value: opt["value"].(string),
}
}
- if opt, ok := getOptByName(fields, "redirect_http_to_https"); ok {
- enabled := true
- if _, ok := opt["enabled"]; ok {
- enabled = opt["enabled"].(bool)
- }
- opts.RedirectHttpToHttps = &cdn.RedirectHttpToHttps{
- Enabled: enabled,
+ if opt, ok := getOptByName(fields, "http3_enabled"); ok {
+ opts.HTTP3Enabled = &cdn.HTTP3Enabled{
+ Enabled: opt["enabled"].(bool),
Value: opt["value"].(bool),
}
}
- if opt, ok := getOptByName(fields, "gzip_on"); ok {
- enabled := true
- if _, ok := opt["enabled"]; ok {
- enabled = opt["enabled"].(bool)
+ if opt, ok := getOptByName(fields, "ignore_cookie"); ok {
+ opts.IgnoreCookie = &cdn.IgnoreCookie{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
}
- opts.GzipOn = &cdn.GzipOn{
- Enabled: enabled,
+ }
+ if opt, ok := getOptByName(fields, "ignore_query_string"); ok {
+ opts.IgnoreQueryString = &cdn.IgnoreQueryString{
+ Enabled: opt["enabled"].(bool),
Value: opt["value"].(bool),
}
}
- if opt, ok := getOptByName(fields, "cors"); ok {
- enabled := true
- if _, ok := opt["enabled"]; ok {
- enabled = opt["enabled"].(bool)
+ if opt, ok := getOptByName(fields, "image_stack"); ok {
+ opts.ImageStack = &cdn.ImageStack{
+ Enabled: opt["enabled"].(bool),
+ Quality: opt["quality"].(int),
}
- opts.Cors = &cdn.Cors{
- Enabled: enabled,
+ if _, ok := opt["avif_enabled"]; ok {
+ opts.ImageStack.AvifEnabled = opt["avif_enabled"].(bool)
}
- for _, v := range opt["value"].(*schema.Set).List() {
- opts.Cors.Value = append(opts.Cors.Value, v.(string))
+ if _, ok := opt["webp_enabled"]; ok {
+ opts.ImageStack.WebpEnabled = opt["webp_enabled"].(bool)
+ }
+ if _, ok := opt["png_lossless"]; ok {
+ opts.ImageStack.PngLossless = opt["png_lossless"].(bool)
}
}
- if opt, ok := getOptByName(fields, "rewrite"); ok {
- enabled := true
- if _, ok := opt["enabled"]; ok {
- enabled = opt["enabled"].(bool)
+ if opt, ok := getOptByName(fields, "ip_address_acl"); ok {
+ opts.IPAddressACL = &cdn.IPAddressACL{
+ Enabled: opt["enabled"].(bool),
+ PolicyType: opt["policy_type"].(string),
}
- opts.Rewrite = &cdn.Rewrite{
- Enabled: enabled,
- Body: opt["body"].(string),
- Flag: opt["flag"].(string),
+ for _, v := range opt["excepted_values"].(*schema.Set).List() {
+ opts.IPAddressACL.ExceptedValues = append(opts.IPAddressACL.ExceptedValues, v.(string))
}
}
- if opt, ok := getOptByName(fields, "webp"); ok {
- enabled := true
- if _, ok := opt["enabled"]; ok {
- enabled = opt["enabled"].(bool)
+ if opt, ok := getOptByName(fields, "limit_bandwidth"); ok {
+ opts.LimitBandwidth = &cdn.LimitBandwidth{
+ Enabled: opt["enabled"].(bool),
+ LimitType: opt["limit_type"].(string),
}
- opts.Webp = &cdn.Webp{
- Enabled: enabled,
- JPGQuality: opt["jpg_quality"].(int),
- PNGQuality: opt["png_quality"].(int),
- PNGLossless: opt["png_lossless"].(bool),
+ if _, ok := opt["speed"]; ok {
+ opts.LimitBandwidth.Speed = opt["speed"].(int)
}
- }
- if opt, ok := getOptByName(fields, "sni"); ok {
- enabled := true
- if _, ok := opt["enabled"]; ok {
- enabled = opt["enabled"].(bool)
+ if _, ok := opt["buffer"]; ok {
+ opts.LimitBandwidth.Buffer = opt["buffer"].(int)
}
- opts.SNI = &cdn.SNIOption{
- Enabled: enabled,
- SNIType: opt["sni_type"].(string),
- CustomHostname: opt["custom_hostname"].(string),
+ }
+ if opt, ok := getOptByName(fields, "proxy_cache_methods_set"); ok {
+ opts.ProxyCacheMethodsSet = &cdn.ProxyCacheMethodsSet{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
}
}
- if opt, ok := getOptByName(fields, "ignore_query_string"); ok {
- enabled := true
- if _, ok := opt["enabled"]; ok {
- enabled = opt["enabled"].(bool)
+ if opt, ok := getOptByName(fields, "query_params_blacklist"); ok {
+ opts.QueryParamsBlacklist = &cdn.QueryParamsBlacklist{
+ Enabled: opt["enabled"].(bool),
}
- opts.IgnoreQueryString = &cdn.IgnoreQueryString{
- Enabled: enabled,
- Value: opt["value"].(bool),
+ for _, v := range opt["value"].(*schema.Set).List() {
+ opts.QueryParamsBlacklist.Value = append(opts.QueryParamsBlacklist.Value, v.(string))
}
}
if opt, ok := getOptByName(fields, "query_params_whitelist"); ok {
- enabled := true
- if _, ok := opt["enabled"]; ok {
- enabled = opt["enabled"].(bool)
- }
opts.QueryParamsWhitelist = &cdn.QueryParamsWhitelist{
- Enabled: enabled,
+ Enabled: opt["enabled"].(bool),
}
for _, v := range opt["value"].(*schema.Set).List() {
opts.QueryParamsWhitelist.Value = append(opts.QueryParamsWhitelist.Value, v.(string))
}
}
- if opt, ok := getOptByName(fields, "query_params_blacklist"); ok {
- enabled := true
- if _, ok := opt["enabled"]; ok {
- enabled = opt["enabled"].(bool)
+ if opt, ok := getOptByName(fields, "redirect_http_to_https"); ok {
+ opts.RedirectHttpToHttps = &cdn.RedirectHttpToHttps{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
}
- opts.QueryParamsBlacklist = &cdn.QueryParamsBlacklist{
- Enabled: enabled,
+ }
+ if opt, ok := getOptByName(fields, "redirect_https_to_http"); ok {
+ opts.RedirectHttpsToHttp = &cdn.RedirectHttpsToHttp{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
}
- for _, v := range opt["value"].(*schema.Set).List() {
- opts.QueryParamsBlacklist.Value = append(opts.QueryParamsBlacklist.Value, v.(string))
+ }
+ if opt, ok := getOptByName(fields, "referrer_acl"); ok {
+ opts.ReferrerACL = &cdn.ReferrerACL{
+ Enabled: opt["enabled"].(bool),
+ PolicyType: opt["policy_type"].(string),
+ }
+ for _, v := range opt["excepted_values"].(*schema.Set).List() {
+ opts.ReferrerACL.ExceptedValues = append(opts.ReferrerACL.ExceptedValues, v.(string))
}
}
- if opt, ok := getOptByName(fields, "static_request_headers"); ok {
- enabled := true
- if _, ok := opt["enabled"]; ok {
- enabled = opt["enabled"].(bool)
+ if opt, ok := getOptByName(fields, "response_headers_hiding_policy"); ok {
+ opts.ResponseHeadersHidingPolicy = &cdn.ResponseHeadersHidingPolicy{
+ Enabled: opt["enabled"].(bool),
+ Mode: opt["mode"].(string),
}
- opts.StaticRequestHeaders = &cdn.StaticRequestHeaders{
- Enabled: enabled,
- Value: map[string]string{},
+ for _, v := range opt["excepted"].(*schema.Set).List() {
+ opts.ResponseHeadersHidingPolicy.Excepted = append(opts.ResponseHeadersHidingPolicy.Excepted, v.(string))
}
- for k, v := range opt["value"].(map[string]interface{}) {
- opts.StaticRequestHeaders.Value[k] = v.(string)
+ }
+ if opt, ok := getOptByName(fields, "rewrite"); ok {
+ opts.Rewrite = &cdn.Rewrite{
+ Enabled: opt["enabled"].(bool),
+ Body: opt["body"].(string),
+ Flag: opt["flag"].(string),
}
}
- if opt, ok := getOptByName(fields, "static_headers"); ok {
- enabled := true
- if _, ok := opt["enabled"]; ok {
- enabled = opt["enabled"].(bool)
+ if opt, ok := getOptByName(fields, "secure_key"); ok {
+ opts.SecureKey = &cdn.SecureKey{
+ Enabled: opt["enabled"].(bool),
+ Key: opt["key"].(string),
+ Type: opt["type"].(int),
+ }
+ }
+ if opt, ok := getOptByName(fields, "slice"); ok {
+ opts.Slice = &cdn.Slice{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
+ if opt, ok := getOptByName(fields, "sni"); ok {
+ opts.SNI = &cdn.SNIOption{
+ Enabled: opt["enabled"].(bool),
+ SNIType: opt["sni_type"].(string),
+ CustomHostname: opt["custom_hostname"].(string),
+ }
+ }
+ if opt, ok := getOptByName(fields, "stale"); ok {
+ opts.Stale = &cdn.Stale{
+ Enabled: opt["enabled"].(bool),
}
+ for _, v := range opt["value"].(*schema.Set).List() {
+ opts.Stale.Value = append(opts.Stale.Value, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "static_headers"); ok {
opts.StaticHeaders = &cdn.StaticHeaders{
- Enabled: enabled,
+ Enabled: opt["enabled"].(bool),
Value: map[string]string{},
}
for k, v := range opt["value"].(map[string]interface{}) {
opts.StaticHeaders.Value[k] = v.(string)
}
}
- if opt, ok := getOptByName(fields, "websockets"); ok {
- enabled := true
- if _, ok := opt["enabled"]; ok {
- enabled = opt["enabled"].(bool)
+ if opt, ok := getOptByName(fields, "static_request_headers"); ok {
+ opts.StaticRequestHeaders = &cdn.StaticRequestHeaders{
+ Enabled: opt["enabled"].(bool),
+ Value: map[string]string{},
}
- opts.WebSockets = &cdn.WebSockets{
- Enabled: enabled,
- Value: opt["value"].(bool),
+ for k, v := range opt["value"].(map[string]interface{}) {
+ opts.StaticRequestHeaders.Value[k] = v.(string)
}
}
- if opt, ok := getOptByName(fields, "tls_versions"); ok {
- enabled := true
- if _, ok := opt["enabled"]; ok {
- enabled = opt["enabled"].(bool)
+ if opt, ok := getOptByName(fields, "static_response_headers"); ok {
+ opts.StaticResponseHeaders = &cdn.StaticResponseHeaders{
+ Enabled: opt["enabled"].(bool),
}
+ for _, v := range opt["value"].([]interface{}) {
+ itemData := v.(map[string]interface{})
+ item := &cdn.StaticResponseHeadersItem{
+ Name: itemData["name"].(string),
+ }
+ for _, val := range itemData["value"].(*schema.Set).List() {
+ item.Value = append(item.Value, val.(string))
+ }
+ if _, ok := itemData["always"]; ok {
+ item.Always = itemData["always"].(bool)
+ }
+ opts.StaticResponseHeaders.Value = append(opts.StaticResponseHeaders.Value, *item)
+ }
+ }
+ if opt, ok := getOptByName(fields, "tls_versions"); ok {
opts.TLSVersions = &cdn.TLSVersions{
- Enabled: enabled,
+ Enabled: opt["enabled"].(bool),
}
for _, v := range opt["value"].(*schema.Set).List() {
opts.TLSVersions.Value = append(opts.TLSVersions.Value, v.(string))
}
}
+ if opt, ok := getOptByName(fields, "use_default_le_chain"); ok {
+ opts.UseDefaultLEChain = &cdn.UseDefaultLEChain{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
+ if opt, ok := getOptByName(fields, "user_agent_acl"); ok {
+ opts.UserAgentACL = &cdn.UserAgentACL{
+ Enabled: opt["enabled"].(bool),
+ PolicyType: opt["policy_type"].(string),
+ }
+ for _, v := range opt["excepted_values"].(*schema.Set).List() {
+ opts.UserAgentACL.ExceptedValues = append(opts.UserAgentACL.ExceptedValues, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "websockets"); ok {
+ opts.WebSockets = &cdn.WebSockets{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
return &opts
}
@@ -809,72 +1499,169 @@ func getOptByName(fields map[string]interface{}, name string) (map[string]interf
return opt, true
}
-func optionsToList(options *cdn.Options) []interface{} {
+func resourceOptionsToList(options *cdn.ResourceOptions) []interface{} {
result := make(map[string][]interface{})
- if options.EdgeCacheSettings != nil {
- m := structToMap(options.EdgeCacheSettings)
- result["edge_cache_settings"] = []interface{}{m}
+ if options.AllowedHTTPMethods != nil {
+ m := structToMap(options.AllowedHTTPMethods)
+ result["allowed_http_methods"] = []interface{}{m}
+ }
+ if options.BrotliCompression != nil {
+ m := structToMap(options.BrotliCompression)
+ result["brotli_compression"] = []interface{}{m}
}
if options.BrowserCacheSettings != nil {
m := structToMap(options.BrowserCacheSettings)
result["browser_cache_settings"] = []interface{}{m}
}
+ if options.CacheHttpHeaders != nil {
+ m := structToMap(options.CacheHttpHeaders)
+ result["cache_http_headers"] = []interface{}{m}
+ }
+ if options.Cors != nil {
+ m := structToMap(options.Cors)
+ result["cors"] = []interface{}{m}
+ }
+ if options.CountryACL != nil {
+ m := structToMap(options.CountryACL)
+ result["country_acl"] = []interface{}{m}
+ }
+ if options.DisableProxyForceRanges != nil {
+ m := structToMap(options.DisableProxyForceRanges)
+ result["disable_proxy_force_ranges"] = []interface{}{m}
+ }
+ if options.EdgeCacheSettings != nil {
+ m := structToMap(options.EdgeCacheSettings)
+ result["edge_cache_settings"] = []interface{}{m}
+ }
+ if options.FetchCompressed != nil {
+ m := structToMap(options.FetchCompressed)
+ result["fetch_compressed"] = []interface{}{m}
+ }
+ if options.FollowOriginRedirect != nil {
+ m := structToMap(options.FollowOriginRedirect)
+ result["follow_origin_redirect"] = []interface{}{m}
+ }
+ if options.ForceReturn != nil {
+ m := structToMap(options.ForceReturn)
+ result["force_return"] = []interface{}{m}
+ }
+ if options.ForwardHostHeader != nil {
+ m := structToMap(options.ForwardHostHeader)
+ result["forward_host_header"] = []interface{}{m}
+ }
+ if options.GzipOn != nil {
+ m := structToMap(options.GzipOn)
+ result["gzip_on"] = []interface{}{m}
+ }
if options.HostHeader != nil {
m := structToMap(options.HostHeader)
result["host_header"] = []interface{}{m}
}
+ if options.HTTP3Enabled != nil {
+ m := structToMap(options.HTTP3Enabled)
+ result["http3_enabled"] = []interface{}{m}
+ }
+ if options.IgnoreCookie != nil {
+ m := structToMap(options.IgnoreCookie)
+ result["ignore_cookie"] = []interface{}{m}
+ }
+ if options.IgnoreQueryString != nil {
+ m := structToMap(options.IgnoreQueryString)
+ result["ignore_query_string"] = []interface{}{m}
+ }
+ if options.ImageStack != nil {
+ m := structToMap(options.ImageStack)
+ result["image_stack"] = []interface{}{m}
+ }
+ if options.IPAddressACL != nil {
+ m := structToMap(options.IPAddressACL)
+ result["ip_address_acl"] = []interface{}{m}
+ }
+ if options.LimitBandwidth != nil {
+ m := structToMap(options.LimitBandwidth)
+ result["limit_bandwidth"] = []interface{}{m}
+ }
+ if options.ProxyCacheMethodsSet != nil {
+ m := structToMap(options.ProxyCacheMethodsSet)
+ result["proxy_cache_methods_set"] = []interface{}{m}
+ }
+ if options.QueryParamsBlacklist != nil {
+ m := structToMap(options.QueryParamsBlacklist)
+ result["query_params_blacklist"] = []interface{}{m}
+ }
+ if options.QueryParamsWhitelist != nil {
+ m := structToMap(options.QueryParamsWhitelist)
+ result["query_params_whitelist"] = []interface{}{m}
+ }
+ if options.RedirectHttpsToHttp != nil {
+ m := structToMap(options.RedirectHttpsToHttp)
+ result["redirect_https_to_http"] = []interface{}{m}
+ }
if options.RedirectHttpToHttps != nil {
m := structToMap(options.RedirectHttpToHttps)
result["redirect_http_to_https"] = []interface{}{m}
}
- if options.GzipOn != nil {
- m := structToMap(options.GzipOn)
- result["gzip_on"] = []interface{}{m}
+ if options.ReferrerACL != nil {
+ m := structToMap(options.ReferrerACL)
+ result["referrer_acl"] = []interface{}{m}
}
- if options.Cors != nil {
- m := structToMap(options.Cors)
- result["cors"] = []interface{}{m}
+ if options.ResponseHeadersHidingPolicy != nil {
+ m := structToMap(options.ResponseHeadersHidingPolicy)
+ result["response_headers_hiding_policy"] = []interface{}{m}
}
if options.Rewrite != nil {
m := structToMap(options.Rewrite)
result["rewrite"] = []interface{}{m}
}
- if options.Webp != nil {
- m := structToMap(options.Webp)
- result["webp"] = []interface{}{m}
+ if options.SecureKey != nil {
+ m := structToMap(options.SecureKey)
+ result["secure_key"] = []interface{}{m}
+ }
+ if options.Slice != nil {
+ m := structToMap(options.Slice)
+ result["slice"] = []interface{}{m}
}
if options.SNI != nil {
m := structToMap(options.SNI)
result["sni"] = []interface{}{m}
}
- if options.IgnoreQueryString != nil {
- m := structToMap(options.IgnoreQueryString)
- result["ignore_query_string"] = []interface{}{m}
- }
- if options.QueryParamsWhitelist != nil {
- m := structToMap(options.QueryParamsWhitelist)
- result["query_params_whitelist"] = []interface{}{m}
+ if options.Stale != nil {
+ m := structToMap(options.Stale)
+ result["stale"] = []interface{}{m}
}
- if options.QueryParamsBlacklist != nil {
- m := structToMap(options.QueryParamsBlacklist)
- result["query_params_blacklist"] = []interface{}{m}
+ if options.StaticHeaders != nil {
+ m := structToMap(options.StaticHeaders)
+ result["static_headers"] = []interface{}{m}
}
if options.StaticRequestHeaders != nil {
m := structToMap(options.StaticRequestHeaders)
result["static_request_headers"] = []interface{}{m}
}
- if options.StaticHeaders != nil {
- m := structToMap(options.StaticHeaders)
- result["static_headers"] = []interface{}{m}
- }
- if options.WebSockets != nil {
- m := structToMap(options.WebSockets)
- result["websockets"] = []interface{}{m}
+ if options.StaticResponseHeaders != nil {
+ m := structToMap(options.StaticResponseHeaders)
+ items := []interface{}{}
+ for _, v := range m["value"].([]cdn.StaticResponseHeadersItem) {
+ items = append(items, structToMap(v))
+ }
+ m["value"] = items
+ result["static_response_headers"] = []interface{}{m}
}
if options.TLSVersions != nil {
m := structToMap(options.TLSVersions)
result["tls_versions"] = []interface{}{m}
}
+ if options.UseDefaultLEChain != nil {
+ m := structToMap(options.UseDefaultLEChain)
+ result["use_default_le_chain"] = []interface{}{m}
+ }
+ if options.UserAgentACL != nil {
+ m := structToMap(options.UserAgentACL)
+ result["user_agent_acl"] = []interface{}{m}
+ }
+ if options.WebSockets != nil {
+ m := structToMap(options.WebSockets)
+ result["websockets"] = []interface{}{m}
+ }
return []interface{}{result}
}
diff --git a/edgecenter/resource_edgecenter_cdn_rule.go b/edgecenter/resource_edgecenter_cdn_rule.go
index 3c560fc4..c20fc8ac 100644
--- a/edgecenter/resource_edgecenter_cdn_rule.go
+++ b/edgecenter/resource_edgecenter_cdn_rule.go
@@ -10,9 +10,866 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+ cdn "github.com/Edge-Center/edgecentercdn-go/edgecenter"
"github.com/Edge-Center/edgecentercdn-go/rules"
)
+var locationOptionsSchema = &schema.Schema{
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Computed: true,
+ Description: "Each option in CDN resource settings. Each option added to CDN resource settings should have the following mandatory request fields: enabled, value.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "allowed_http_methods": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "brotli_compression": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "browser_cache_settings": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "cache_http_headers": { // Deprecated. Use - response_headers_hiding_policy.
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "cors": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ "always": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "country_acl": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "policy_type": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "excepted_values": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "disable_proxy_force_ranges": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
+ "edge_cache_settings": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Computed: true,
+ Description: "The cache expiration time for CDN servers.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Caching time for a response with codes 200, 206, 301, 302. Responses with codes 4xx, 5xx will not be cached. Use '0s' disable to caching. Use custom_values field to specify a custom caching time for a response with specific codes.",
+ },
+ "default": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Content will be cached according to origin cache settings. The value applies for a response with codes 200, 201, 204, 206, 301, 302, 303, 304, 307, 308 if an origin server does not have caching HTTP headers. Responses with other codes will not be cached.",
+ },
+ "custom_values": {
+ Type: schema.TypeMap,
+ Optional: true,
+ Computed: true,
+ DefaultFunc: func() (interface{}, error) {
+ return map[string]interface{}{}, nil
+ },
+ Elem: schema.TypeString,
+ Description: "Caching time for a response with specific codes. These settings have a higher priority than the value field. Response code ('304', '404' for example). Use 'any' to specify caching time for all response codes. Caching time in seconds ('0s', '600s' for example). Use '0s' to disable caching for a specific response code.",
+ },
+ },
+ },
+ },
+ "fetch_compressed": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
+ "follow_origin_redirect": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "codes": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeInt},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "force_return": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "code": {
+ Type: schema.TypeInt,
+ Required: true,
+ Description: "",
+ },
+ "body": {
+ Type: schema.TypeString,
+ Optional: true,
+ Default: "",
+ Description: "",
+ },
+ },
+ },
+ },
+ "forward_host_header": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
+ "gzip_on": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
+ "host_header": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "Specify the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header. If the option is in NULL state Host Header value is taken from the CNAME field.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeString,
+ Required: true,
+ },
+ },
+ },
+ },
+ "ignore_cookie": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
+ "ignore_query_string": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
+ "image_stack": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "avif_enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ },
+ "webp_enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ },
+ "quality": {
+ Type: schema.TypeInt,
+ Required: true,
+ Description: "",
+ },
+ "png_lossless": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "ip_address_acl": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "policy_type": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "excepted_values": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "limit_bandwidth": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "limit_type": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "speed": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ },
+ "buffer": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "proxy_cache_methods_set": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
+ "query_params_blacklist": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ },
+ },
+ },
+ },
+ "query_params_whitelist": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ },
+ },
+ },
+ },
+ "redirect_http_to_https": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "Sets redirect from HTTP protocol to HTTPS for all resource requests.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
+ "redirect_https_to_http": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
+ "referrer_acl": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "policy_type": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "Possible values: allow, deny.",
+ },
+ "excepted_values": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "response_headers_hiding_policy": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "mode": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "excepted": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "rewrite": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "body": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "flag": {
+ Type: schema.TypeString,
+ Optional: true,
+ Default: "break",
+ Description: "",
+ },
+ },
+ },
+ },
+ "secure_key": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "key": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "type": {
+ Type: schema.TypeInt,
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "slice": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
+ "sni": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "sni_type": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Available values 'dynamic' or 'custom'",
+ },
+ "custom_hostname": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Required to set custom hostname in case sni-type='custom'",
+ },
+ },
+ },
+ },
+ "stale": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "static_headers": { // Deprecated. Use - static_response_headers.
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "Option has been deprecated. Use - static_response_headers.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeMap,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ },
+ },
+ },
+ },
+ "static_request_headers": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeMap,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "static_response_headers": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "Specify custom HTTP Headers that a CDN server adds to a response.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeList,
+ Required: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "value": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ "always": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Computed: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "user_agent_acl": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "policy_type": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "",
+ },
+ "excepted_values": {
+ Type: schema.TypeSet,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Required: true,
+ Description: "",
+ },
+ },
+ },
+ },
+ "websockets": {
+ Type: schema.TypeList,
+ MaxItems: 1,
+ Optional: true,
+ Description: "",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ },
+ "value": {
+ Type: schema.TypeBool,
+ Required: true,
+ },
+ },
+ },
+ },
+ },
+ },
+}
+
func resourceCDNRule() *schema.Resource {
return &schema.Resource{
Importer: &schema.ResourceImporter{
@@ -33,10 +890,17 @@ func resourceCDNRule() *schema.Resource {
Required: true,
Description: "A pattern that defines when the rule is triggered. By default, we add a leading forward slash to any rule pattern. Specify a pattern without a forward slash.",
},
- "rule_type": {
+ "active": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Computed: true,
+ Description: "Shows if the location is enabled.",
+ },
+ "weight": {
Type: schema.TypeInt,
- Required: true,
- Description: "Type of rule. The rule is applied if the requested URI matches the rule pattern. It has two possible values: Type 0 — RegEx. Must start with '^/' or '/'. Type 1 — RegEx. Legacy type. Note that for this rule type we automatically add / to each rule pattern before your regular expression. Please use Type 0.",
+ Optional: true,
+ Computed: true,
+ Description: "",
},
"origin_group": {
Type: schema.TypeInt,
@@ -46,9 +910,10 @@ func resourceCDNRule() *schema.Resource {
"origin_protocol": {
Type: schema.TypeString,
Optional: true,
+ Computed: true,
Description: "This option defines the protocol that will be used by CDN servers to request content from an origin source. If not specified, it will be inherit from resource. Possible values are: HTTPS, HTTP, MATCH.",
},
- "options": optionsSchema,
+ "options": locationOptionsSchema,
},
CreateContext: resourceCDNRuleCreate,
ReadContext: resourceCDNRuleRead,
@@ -66,7 +931,14 @@ func resourceCDNRuleCreate(ctx context.Context, d *schema.ResourceData, m interf
var req rules.CreateRequest
req.Name = d.Get("name").(string)
req.Rule = d.Get("rule").(string)
- req.RuleType = d.Get("rule_type").(int)
+
+ if d.Get("active") != nil {
+ req.Active = d.Get("active").(bool)
+ }
+
+ if d.Get("weight") != nil {
+ req.Weight = d.Get("weight").(int)
+ }
if d.Get("origin_group") != nil && d.Get("origin_group").(int) > 0 {
req.OriginGroup = pointer.ToInt(d.Get("origin_group").(int))
@@ -78,7 +950,7 @@ func resourceCDNRuleCreate(ctx context.Context, d *schema.ResourceData, m interf
resourceID := d.Get("resource_id").(int)
- req.Options = listToOptions(d.Get("options").([]interface{}))
+ req.Options = listToLocationOptions(d.Get("options").([]interface{}))
result, err := client.Rules().Create(ctx, int64(resourceID), &req)
if err != nil {
@@ -113,10 +985,11 @@ func resourceCDNRuleRead(ctx context.Context, d *schema.ResourceData, m interfac
d.Set("name", result.Name)
d.Set("rule", result.Pattern)
- d.Set("rule_type", result.Type)
+ d.Set("active", result.Active)
d.Set("origin_group", result.OriginGroup)
d.Set("origin_protocol", result.OriginProtocol)
- if err := d.Set("options", optionsToList(result.Options)); err != nil {
+ d.Set("weight", result.Weight)
+ if err := d.Set("options", locationOptionsToList(result.Options)); err != nil {
return diag.FromErr(err)
}
@@ -139,7 +1012,11 @@ func resourceCDNRuleUpdate(ctx context.Context, d *schema.ResourceData, m interf
var req rules.UpdateRequest
req.Name = d.Get("name").(string)
req.Rule = d.Get("rule").(string)
- req.RuleType = d.Get("rule_type").(int)
+ req.Active = d.Get("active").(bool)
+
+ if d.Get("weight") != nil {
+ req.Weight = d.Get("weight").(int)
+ }
if d.Get("origin_group") != nil && d.Get("origin_group").(int) > 0 {
req.OriginGroup = pointer.ToInt(d.Get("origin_group").(int))
@@ -149,7 +1026,7 @@ func resourceCDNRuleUpdate(ctx context.Context, d *schema.ResourceData, m interf
req.OverrideOriginProtocol = pointer.ToString(d.Get("origin_protocol").(string))
}
- req.Options = listToOptions(d.Get("options").([]interface{}))
+ req.Options = listToLocationOptions(d.Get("options").([]interface{}))
resourceID := d.Get("resource_id").(int)
@@ -184,3 +1061,464 @@ func resourceCDNRuleDelete(ctx context.Context, d *schema.ResourceData, m interf
return nil
}
+
+func listToLocationOptions(l []interface{}) *cdn.LocationOptions {
+ if len(l) == 0 {
+ return nil
+ }
+
+ var opts cdn.LocationOptions
+ fields := l[0].(map[string]interface{})
+ if opt, ok := getOptByName(fields, "allowed_http_methods"); ok {
+ opts.AllowedHTTPMethods = &cdn.AllowedHTTPMethods{
+ Enabled: opt["enabled"].(bool),
+ }
+ for _, v := range opt["value"].(*schema.Set).List() {
+ opts.AllowedHTTPMethods.Value = append(opts.AllowedHTTPMethods.Value, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "brotli_compression"); ok {
+ opts.BrotliCompression = &cdn.BrotliCompression{
+ Enabled: opt["enabled"].(bool),
+ }
+ for _, v := range opt["value"].(*schema.Set).List() {
+ opts.BrotliCompression.Value = append(opts.BrotliCompression.Value, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "browser_cache_settings"); ok {
+ opts.BrowserCacheSettings = &cdn.BrowserCacheSettings{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(string),
+ }
+ }
+ if opt, ok := getOptByName(fields, "cache_http_headers"); ok {
+ opts.CacheHttpHeaders = &cdn.CacheHttpHeaders{
+ Enabled: opt["enabled"].(bool),
+ }
+ for _, v := range opt["value"].(*schema.Set).List() {
+ opts.CacheHttpHeaders.Value = append(opts.CacheHttpHeaders.Value, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "cors"); ok {
+ opts.Cors = &cdn.Cors{
+ Enabled: opt["enabled"].(bool),
+ }
+ for _, v := range opt["value"].(*schema.Set).List() {
+ opts.Cors.Value = append(opts.Cors.Value, v.(string))
+ }
+ if _, ok := opt["always"]; ok {
+ opts.Cors.Always = opt["always"].(bool)
+ }
+ }
+ if opt, ok := getOptByName(fields, "country_acl"); ok {
+ opts.CountryACL = &cdn.CountryACL{
+ Enabled: opt["enabled"].(bool),
+ PolicyType: opt["policy_type"].(string),
+ }
+ for _, v := range opt["excepted_values"].(*schema.Set).List() {
+ opts.CountryACL.ExceptedValues = append(opts.CountryACL.ExceptedValues, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "disable_proxy_force_ranges"); ok {
+ opts.DisableProxyForceRanges = &cdn.DisableProxyForceRanges{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
+ if opt, ok := getOptByName(fields, "edge_cache_settings"); ok {
+ rawCustomVals := opt["custom_values"].(map[string]interface{})
+ customVals := make(map[string]string, len(rawCustomVals))
+ for key, value := range rawCustomVals {
+ customVals[key] = value.(string)
+ }
+
+ opts.EdgeCacheSettings = &cdn.EdgeCacheSettings{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(string),
+ CustomValues: customVals,
+ Default: opt["default"].(string),
+ }
+ }
+ if opt, ok := getOptByName(fields, "fetch_compressed"); ok {
+ opts.FetchCompressed = &cdn.FetchCompressed{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
+ if opt, ok := getOptByName(fields, "follow_origin_redirect"); ok {
+ opts.FollowOriginRedirect = &cdn.FollowOriginRedirect{
+ Enabled: opt["enabled"].(bool),
+ }
+ for _, v := range opt["codes"].(*schema.Set).List() {
+ opts.FollowOriginRedirect.Codes = append(opts.FollowOriginRedirect.Codes, v.(int))
+ }
+ }
+ if opt, ok := getOptByName(fields, "force_return"); ok {
+ opts.ForceReturn = &cdn.ForceReturn{
+ Enabled: opt["enabled"].(bool),
+ Code: opt["code"].(int),
+ Body: opt["body"].(string),
+ }
+ }
+ if opt, ok := getOptByName(fields, "forward_host_header"); ok {
+ opts.ForwardHostHeader = &cdn.ForwardHostHeader{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
+ if opt, ok := getOptByName(fields, "gzip_on"); ok {
+ opts.GzipOn = &cdn.GzipOn{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
+ if opt, ok := getOptByName(fields, "host_header"); ok {
+ opts.HostHeader = &cdn.HostHeader{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(string),
+ }
+ }
+ if opt, ok := getOptByName(fields, "ignore_cookie"); ok {
+ opts.IgnoreCookie = &cdn.IgnoreCookie{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
+ if opt, ok := getOptByName(fields, "ignore_query_string"); ok {
+ opts.IgnoreQueryString = &cdn.IgnoreQueryString{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
+ if opt, ok := getOptByName(fields, "image_stack"); ok {
+ opts.ImageStack = &cdn.ImageStack{
+ Enabled: opt["enabled"].(bool),
+ Quality: opt["quality"].(int),
+ }
+ if _, ok := opt["avif_enabled"]; ok {
+ opts.ImageStack.AvifEnabled = opt["avif_enabled"].(bool)
+ }
+ if _, ok := opt["webp_enabled"]; ok {
+ opts.ImageStack.WebpEnabled = opt["webp_enabled"].(bool)
+ }
+ if _, ok := opt["png_lossless"]; ok {
+ opts.ImageStack.PngLossless = opt["png_lossless"].(bool)
+ }
+ }
+ if opt, ok := getOptByName(fields, "ip_address_acl"); ok {
+ opts.IPAddressACL = &cdn.IPAddressACL{
+ Enabled: opt["enabled"].(bool),
+ PolicyType: opt["policy_type"].(string),
+ }
+ for _, v := range opt["excepted_values"].(*schema.Set).List() {
+ opts.IPAddressACL.ExceptedValues = append(opts.IPAddressACL.ExceptedValues, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "limit_bandwidth"); ok {
+ opts.LimitBandwidth = &cdn.LimitBandwidth{
+ Enabled: opt["enabled"].(bool),
+ LimitType: opt["limit_type"].(string),
+ }
+ if _, ok := opt["speed"]; ok {
+ opts.LimitBandwidth.Speed = opt["speed"].(int)
+ }
+ if _, ok := opt["buffer"]; ok {
+ opts.LimitBandwidth.Buffer = opt["buffer"].(int)
+ }
+ }
+ if opt, ok := getOptByName(fields, "proxy_cache_methods_set"); ok {
+ opts.ProxyCacheMethodsSet = &cdn.ProxyCacheMethodsSet{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
+ if opt, ok := getOptByName(fields, "query_params_blacklist"); ok {
+ opts.QueryParamsBlacklist = &cdn.QueryParamsBlacklist{
+ Enabled: opt["enabled"].(bool),
+ }
+ for _, v := range opt["value"].(*schema.Set).List() {
+ opts.QueryParamsBlacklist.Value = append(opts.QueryParamsBlacklist.Value, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "query_params_whitelist"); ok {
+ opts.QueryParamsWhitelist = &cdn.QueryParamsWhitelist{
+ Enabled: opt["enabled"].(bool),
+ }
+ for _, v := range opt["value"].(*schema.Set).List() {
+ opts.QueryParamsWhitelist.Value = append(opts.QueryParamsWhitelist.Value, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "redirect_http_to_https"); ok {
+ opts.RedirectHttpToHttps = &cdn.RedirectHttpToHttps{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
+ if opt, ok := getOptByName(fields, "redirect_https_to_http"); ok {
+ opts.RedirectHttpsToHttp = &cdn.RedirectHttpsToHttp{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
+ if opt, ok := getOptByName(fields, "referrer_acl"); ok {
+ opts.ReferrerACL = &cdn.ReferrerACL{
+ Enabled: opt["enabled"].(bool),
+ PolicyType: opt["policy_type"].(string),
+ }
+ for _, v := range opt["excepted_values"].(*schema.Set).List() {
+ opts.ReferrerACL.ExceptedValues = append(opts.ReferrerACL.ExceptedValues, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "response_headers_hiding_policy"); ok {
+ opts.ResponseHeadersHidingPolicy = &cdn.ResponseHeadersHidingPolicy{
+ Enabled: opt["enabled"].(bool),
+ Mode: opt["mode"].(string),
+ }
+ for _, v := range opt["excepted"].(*schema.Set).List() {
+ opts.ResponseHeadersHidingPolicy.Excepted = append(opts.ResponseHeadersHidingPolicy.Excepted, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "rewrite"); ok {
+ opts.Rewrite = &cdn.Rewrite{
+ Enabled: opt["enabled"].(bool),
+ Body: opt["body"].(string),
+ Flag: opt["flag"].(string),
+ }
+ }
+ if opt, ok := getOptByName(fields, "secure_key"); ok {
+ opts.SecureKey = &cdn.SecureKey{
+ Enabled: opt["enabled"].(bool),
+ Key: opt["key"].(string),
+ Type: opt["type"].(int),
+ }
+ }
+ if opt, ok := getOptByName(fields, "slice"); ok {
+ opts.Slice = &cdn.Slice{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
+ if opt, ok := getOptByName(fields, "sni"); ok {
+ opts.SNI = &cdn.SNIOption{
+ Enabled: opt["enabled"].(bool),
+ SNIType: opt["sni_type"].(string),
+ CustomHostname: opt["custom_hostname"].(string),
+ }
+ }
+ if opt, ok := getOptByName(fields, "stale"); ok {
+ opts.Stale = &cdn.Stale{
+ Enabled: opt["enabled"].(bool),
+ }
+ for _, v := range opt["value"].(*schema.Set).List() {
+ opts.Stale.Value = append(opts.Stale.Value, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "static_headers"); ok {
+ opts.StaticHeaders = &cdn.StaticHeaders{
+ Enabled: opt["enabled"].(bool),
+ Value: map[string]string{},
+ }
+ for k, v := range opt["value"].(map[string]interface{}) {
+ opts.StaticHeaders.Value[k] = v.(string)
+ }
+ }
+ if opt, ok := getOptByName(fields, "static_request_headers"); ok {
+ opts.StaticRequestHeaders = &cdn.StaticRequestHeaders{
+ Enabled: opt["enabled"].(bool),
+ Value: map[string]string{},
+ }
+ for k, v := range opt["value"].(map[string]interface{}) {
+ opts.StaticRequestHeaders.Value[k] = v.(string)
+ }
+ }
+ if opt, ok := getOptByName(fields, "static_response_headers"); ok {
+ opts.StaticResponseHeaders = &cdn.StaticResponseHeaders{
+ Enabled: opt["enabled"].(bool),
+ }
+ for _, v := range opt["value"].([]interface{}) {
+ itemData := v.(map[string]interface{})
+ item := &cdn.StaticResponseHeadersItem{
+ Name: itemData["name"].(string),
+ }
+ for _, val := range itemData["value"].(*schema.Set).List() {
+ item.Value = append(item.Value, val.(string))
+ }
+ if _, ok := itemData["always"]; ok {
+ item.Always = itemData["always"].(bool)
+ }
+ opts.StaticResponseHeaders.Value = append(opts.StaticResponseHeaders.Value, *item)
+ }
+ }
+ if opt, ok := getOptByName(fields, "user_agent_acl"); ok {
+ opts.UserAgentACL = &cdn.UserAgentACL{
+ Enabled: opt["enabled"].(bool),
+ PolicyType: opt["policy_type"].(string),
+ }
+ for _, v := range opt["excepted_values"].(*schema.Set).List() {
+ opts.UserAgentACL.ExceptedValues = append(opts.UserAgentACL.ExceptedValues, v.(string))
+ }
+ }
+ if opt, ok := getOptByName(fields, "websockets"); ok {
+ opts.WebSockets = &cdn.WebSockets{
+ Enabled: opt["enabled"].(bool),
+ Value: opt["value"].(bool),
+ }
+ }
+
+ return &opts
+}
+
+func locationOptionsToList(options *cdn.LocationOptions) []interface{} {
+ result := make(map[string][]interface{})
+ if options.AllowedHTTPMethods != nil {
+ m := structToMap(options.AllowedHTTPMethods)
+ result["allowed_http_methods"] = []interface{}{m}
+ }
+ if options.BrotliCompression != nil {
+ m := structToMap(options.BrotliCompression)
+ result["brotli_compression"] = []interface{}{m}
+ }
+ if options.BrowserCacheSettings != nil {
+ m := structToMap(options.BrowserCacheSettings)
+ result["browser_cache_settings"] = []interface{}{m}
+ }
+ if options.CacheHttpHeaders != nil {
+ m := structToMap(options.CacheHttpHeaders)
+ result["cache_http_headers"] = []interface{}{m}
+ }
+ if options.Cors != nil {
+ m := structToMap(options.Cors)
+ result["cors"] = []interface{}{m}
+ }
+ if options.CountryACL != nil {
+ m := structToMap(options.CountryACL)
+ result["country_acl"] = []interface{}{m}
+ }
+ if options.DisableProxyForceRanges != nil {
+ m := structToMap(options.DisableProxyForceRanges)
+ result["disable_proxy_force_ranges"] = []interface{}{m}
+ }
+ if options.EdgeCacheSettings != nil {
+ m := structToMap(options.EdgeCacheSettings)
+ result["edge_cache_settings"] = []interface{}{m}
+ }
+ if options.FetchCompressed != nil {
+ m := structToMap(options.FetchCompressed)
+ result["fetch_compressed"] = []interface{}{m}
+ }
+ if options.FollowOriginRedirect != nil {
+ m := structToMap(options.FollowOriginRedirect)
+ result["follow_origin_redirect"] = []interface{}{m}
+ }
+ if options.ForceReturn != nil {
+ m := structToMap(options.ForceReturn)
+ result["force_return"] = []interface{}{m}
+ }
+ if options.ForwardHostHeader != nil {
+ m := structToMap(options.ForwardHostHeader)
+ result["forward_host_header"] = []interface{}{m}
+ }
+ if options.GzipOn != nil {
+ m := structToMap(options.GzipOn)
+ result["gzip_on"] = []interface{}{m}
+ }
+ if options.HostHeader != nil {
+ m := structToMap(options.HostHeader)
+ result["host_header"] = []interface{}{m}
+ }
+ if options.IgnoreCookie != nil {
+ m := structToMap(options.IgnoreCookie)
+ result["ignore_cookie"] = []interface{}{m}
+ }
+ if options.IgnoreQueryString != nil {
+ m := structToMap(options.IgnoreQueryString)
+ result["ignore_query_string"] = []interface{}{m}
+ }
+ if options.ImageStack != nil {
+ m := structToMap(options.ImageStack)
+ result["image_stack"] = []interface{}{m}
+ }
+ if options.IPAddressACL != nil {
+ m := structToMap(options.IPAddressACL)
+ result["ip_address_acl"] = []interface{}{m}
+ }
+ if options.LimitBandwidth != nil {
+ m := structToMap(options.LimitBandwidth)
+ result["limit_bandwidth"] = []interface{}{m}
+ }
+ if options.ProxyCacheMethodsSet != nil {
+ m := structToMap(options.ProxyCacheMethodsSet)
+ result["proxy_cache_methods_set"] = []interface{}{m}
+ }
+ if options.QueryParamsBlacklist != nil {
+ m := structToMap(options.QueryParamsBlacklist)
+ result["query_params_blacklist"] = []interface{}{m}
+ }
+ if options.QueryParamsWhitelist != nil {
+ m := structToMap(options.QueryParamsWhitelist)
+ result["query_params_whitelist"] = []interface{}{m}
+ }
+ if options.RedirectHttpsToHttp != nil {
+ m := structToMap(options.RedirectHttpsToHttp)
+ result["redirect_https_to_http"] = []interface{}{m}
+ }
+ if options.RedirectHttpToHttps != nil {
+ m := structToMap(options.RedirectHttpToHttps)
+ result["redirect_http_to_https"] = []interface{}{m}
+ }
+ if options.ReferrerACL != nil {
+ m := structToMap(options.ReferrerACL)
+ result["referrer_acl"] = []interface{}{m}
+ }
+ if options.ResponseHeadersHidingPolicy != nil {
+ m := structToMap(options.ResponseHeadersHidingPolicy)
+ result["response_headers_hiding_policy"] = []interface{}{m}
+ }
+ if options.Rewrite != nil {
+ m := structToMap(options.Rewrite)
+ result["rewrite"] = []interface{}{m}
+ }
+ if options.SecureKey != nil {
+ m := structToMap(options.SecureKey)
+ result["secure_key"] = []interface{}{m}
+ }
+ if options.Slice != nil {
+ m := structToMap(options.Slice)
+ result["slice"] = []interface{}{m}
+ }
+ if options.SNI != nil {
+ m := structToMap(options.SNI)
+ result["sni"] = []interface{}{m}
+ }
+ if options.Stale != nil {
+ m := structToMap(options.Stale)
+ result["stale"] = []interface{}{m}
+ }
+ if options.StaticHeaders != nil {
+ m := structToMap(options.StaticHeaders)
+ result["static_headers"] = []interface{}{m}
+ }
+ if options.StaticRequestHeaders != nil {
+ m := structToMap(options.StaticRequestHeaders)
+ result["static_request_headers"] = []interface{}{m}
+ }
+ if options.StaticResponseHeaders != nil {
+ m := structToMap(options.StaticResponseHeaders)
+ items := []interface{}{}
+ for _, v := range m["value"].([]cdn.StaticResponseHeadersItem) {
+ items = append(items, structToMap(v))
+ }
+ m["value"] = items
+ result["static_response_headers"] = []interface{}{m}
+ }
+ if options.UserAgentACL != nil {
+ m := structToMap(options.UserAgentACL)
+ result["user_agent_acl"] = []interface{}{m}
+ }
+ if options.WebSockets != nil {
+ m := structToMap(options.WebSockets)
+ result["websockets"] = []interface{}{m}
+ }
+
+ return []interface{}{result}
+}
diff --git a/edgecenter/test/resource_edgecenter_cdn_rule_test.go b/edgecenter/test/resource_edgecenter_cdn_rule_test.go
index 11cefd7a..51afad1c 100644
--- a/edgecenter/test/resource_edgecenter_cdn_rule_test.go
+++ b/edgecenter/test/resource_edgecenter_cdn_rule_test.go
@@ -42,7 +42,6 @@ resource "edgecenter_cdn_rule" "acctest" {
resource_id = %s
name = "%s"
rule = "%s"
- rule_type = 0
%s
}
`, EC_CDN_RESOURCE_ID, params.Name, params.Pattern, params.RawPart)
diff --git a/examples/resources/edgecenter_cdn_rule/resource.tf b/examples/resources/edgecenter_cdn_rule/resource.tf
index 01cd5b80..735493bd 100644
--- a/examples/resources/edgecenter_cdn_rule/resource.tf
+++ b/examples/resources/edgecenter_cdn_rule/resource.tf
@@ -6,7 +6,6 @@ resource "edgecenter_cdn_rule" "cdn_example_com_rule_1" {
resource_id = edgecenter_cdn_resource.cdn_example_com.id
name = "All PNG images"
rule = "/folder/images/*.png"
- rule_type = 0
options {
edge_cache_settings {
@@ -43,7 +42,6 @@ resource "edgecenter_cdn_rule" "cdn_example_com_rule_2" {
resource_id = edgecenter_cdn_resource.cdn_example_com.id
name = "All JS scripts"
rule = "/folder/images/*.js"
- rule_type = 0
origin_protocol = "HTTP"
options {
diff --git a/go.mod b/go.mod
index 76ee679b..fe83cfcb 100644
--- a/go.mod
+++ b/go.mod
@@ -6,7 +6,7 @@ require (
github.com/AlekSi/pointer v1.2.0
github.com/Edge-Center/edgecenter-dns-sdk-go v0.1.0
github.com/Edge-Center/edgecenter-storage-sdk-go v0.2.0
- github.com/Edge-Center/edgecentercdn-go v0.1.1
+ github.com/Edge-Center/edgecentercdn-go v0.1.4
github.com/Edge-Center/edgecentercloud-go v0.1.10
github.com/hashicorp/go-cty v1.4.1-0.20200723130312-85980079f637
github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0
diff --git a/go.sum b/go.sum
index 1d7040e9..9031f562 100644
--- a/go.sum
+++ b/go.sum
@@ -6,8 +6,8 @@ github.com/Edge-Center/edgecenter-dns-sdk-go v0.1.0 h1:MDQr/60IhD1x7f5Bs20ljTQXG
github.com/Edge-Center/edgecenter-dns-sdk-go v0.1.0/go.mod h1:xWN2LYVokamADMRz1cPhOrYX/NlxiDJp9tjBumHU5G8=
github.com/Edge-Center/edgecenter-storage-sdk-go v0.2.0 h1:1aPDpywWbaF7VEjP/GjVoSgcipxWTTzEPPZv5kOWE8A=
github.com/Edge-Center/edgecenter-storage-sdk-go v0.2.0/go.mod h1:TcWO0BPvDsE6AGlPBqpKCZhoQ70rRlqmm85J32qcL8I=
-github.com/Edge-Center/edgecentercdn-go v0.1.1 h1:oRYPMYAA6EzwM8nD32waglmmOHyKfyRD5RxqJBYg7y0=
-github.com/Edge-Center/edgecentercdn-go v0.1.1/go.mod h1:RwEyxwPAmxor1mZKUTa2bIU2p5qM6kcAofUkaE4O1V4=
+github.com/Edge-Center/edgecentercdn-go v0.1.4 h1:Jt8f+CSriwVQ/KAb+a+v1dDNChtHjlpilgJOX8mOSx0=
+github.com/Edge-Center/edgecentercdn-go v0.1.4/go.mod h1:RwEyxwPAmxor1mZKUTa2bIU2p5qM6kcAofUkaE4O1V4=
github.com/Edge-Center/edgecentercloud-go v0.1.10 h1:+mtt9/n4RBTKZwF0N5xlvCNTE74R+Qk29Na+zZgy/Vk=
github.com/Edge-Center/edgecentercloud-go v0.1.10/go.mod h1:kmXGtx0lL1ib+SPfJe/uIAyDHamquAvqiftoLSyhxF8=
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=