Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 3bcd786

Browse files
vvelikodnyVitaly Velikodny
andauthored
update CDN resources docs (#75)
* update CDN resources docs * update CDN resources docs Co-authored-by: Vitaly Velikodny <[email protected]>
1 parent e566ac9 commit 3bcd786

File tree

9 files changed

+289
-40
lines changed

9 files changed

+289
-40
lines changed

docs/index.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ terraform {
2424
}
2525
2626
provider gcore {
27-
# user_name = "test"
28-
# password = "test"
29-
# ignore_creds_auth_error = true
3027
permanent_api_token = "251$d3361.............1b35f26d8"
28+
29+
# user_name = "test"
30+
# password = "test"
31+
ignore_creds_auth_error = true
32+
3133
gcore_api = "https://api.cloud.gcorelabs.com"
3234
gcore_dns_api = "https://dnsapi.gcorelabs.com"
3335
gcore_platform = "https://api.gcdn.co"

docs/resources/gcore_cdn_origingroup.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ Represent origin group
1414

1515
```terraform
1616
provider gcore {
17-
user_name = "test"
18-
password = "test"
17+
# G-Core dashboard => Profile => API tokens => Create token
18+
permanent_api_token = ""
19+
20+
# user_name = "test"
21+
# password = "test"
22+
1923
gcore_platform = "https://api.gcdn.co"
2024
gcore_cdn_api = "https://api.gcdn.co"
2125
}

docs/resources/gcore_cdn_resource.md

Lines changed: 116 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,49 @@ Represent CDN resource
1414

1515
```terraform
1616
provider gcore {
17-
user_name = "test"
18-
password = "test"
17+
# G-Core dashboard => Profile => API tokens => Create token
18+
permanent_api_token = ""
19+
20+
# user_name = "test"
21+
# password = "test"
22+
1923
gcore_platform = "https://api.gcdn.co"
2024
gcore_cdn_api = "https://api.gcdn.co"
2125
}
2226
2327
2428
resource "gcore_cdn_resource" "cdn_example_com" {
2529
cname = "cdn.example.com"
26-
origin_group = 11
30+
origin_group = gcore_cdn_origingroup.origin_group_1.id
2731
origin_protocol = "MATCH"
2832
secondary_hostnames = ["cdn2.example.com"]
33+
34+
options {
35+
edge_cache_settings {
36+
default = "8d"
37+
}
38+
browser_cache_settings {
39+
value = "1d"
40+
}
41+
redirect_http_to_https {
42+
value = true
43+
}
44+
gzip_on {
45+
value = true
46+
}
47+
cors {
48+
value = [
49+
"*"
50+
]
51+
}
52+
rewrite {
53+
body = "/(.*) /$1"
54+
}
55+
webp {
56+
jpg_quality = 55
57+
png_quality = 66
58+
}
59+
}
2960
}
3061
```
3162

@@ -39,6 +70,7 @@ resource "gcore_cdn_resource" "cdn_example_com" {
3970
### Optional
4071

4172
- **active** (Boolean) The setting allows to enable or disable a CDN Resource
73+
- **description** (String) Custom client description of the resource.
4274
- **id** (String) The ID of this resource.
4375
- **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))
4476
- **origin** (String) A domain name or IP of your origin source. Specify a port if custom. You can use either 'origin' parameter or 'originGroup' in the resource definition.
@@ -57,29 +89,107 @@ resource "gcore_cdn_resource" "cdn_example_com" {
5789

5890
Optional:
5991

92+
- **browser_cache_settings** (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--browser_cache_settings))
93+
- **cors** (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--cors))
6094
- **edge_cache_settings** (Block List, Max: 1) The cache expiration time for CDN servers. (see [below for nested schema](#nestedblock--options--edge_cache_settings))
95+
- **gzip_on** (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--gzip_on))
6196
- **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))
97+
- **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))
98+
- **rewrite** (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--rewrite))
99+
- **webp** (Block List, Max: 1) (see [below for nested schema](#nestedblock--options--webp))
62100

63-
<a id="nestedblock--options--edge_cache_settings"></a>
64-
### Nested Schema for `options.edge_cache_settings`
101+
<a id="nestedblock--options--browser_cache_settings"></a>
102+
### Nested Schema for `options.browser_cache_settings`
103+
104+
Optional:
105+
106+
- **enabled** (Boolean)
107+
- **value** (String)
108+
109+
110+
<a id="nestedblock--options--cors"></a>
111+
### Nested Schema for `options.cors`
65112

66113
Required:
67114

115+
- **value** (Set of String)
116+
117+
Optional:
118+
68119
- **enabled** (Boolean)
69120

121+
122+
<a id="nestedblock--options--edge_cache_settings"></a>
123+
### Nested Schema for `options.edge_cache_settings`
124+
70125
Optional:
71126

72127
- **custom_values** (Map of String) 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.
73128
- **default** (String) 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.
129+
- **enabled** (Boolean)
74130
- **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.
75131

76132

133+
<a id="nestedblock--options--gzip_on"></a>
134+
### Nested Schema for `options.gzip_on`
135+
136+
Required:
137+
138+
- **value** (Boolean)
139+
140+
Optional:
141+
142+
- **enabled** (Boolean)
143+
144+
77145
<a id="nestedblock--options--host_header"></a>
78146
### Nested Schema for `options.host_header`
79147

80148
Required:
81149

82-
- **enabled** (Boolean)
83150
- **value** (String)
84151

152+
Optional:
153+
154+
- **enabled** (Boolean)
155+
156+
157+
<a id="nestedblock--options--redirect_http_to_https"></a>
158+
### Nested Schema for `options.redirect_http_to_https`
159+
160+
Required:
161+
162+
- **value** (Boolean)
163+
164+
Optional:
165+
166+
- **enabled** (Boolean)
167+
168+
169+
<a id="nestedblock--options--rewrite"></a>
170+
### Nested Schema for `options.rewrite`
171+
172+
Required:
173+
174+
- **body** (String)
175+
176+
Optional:
177+
178+
- **enabled** (Boolean)
179+
- **flag** (String)
180+
181+
182+
<a id="nestedblock--options--webp"></a>
183+
### Nested Schema for `options.webp`
184+
185+
Required:
186+
187+
- **jpg_quality** (Number)
188+
- **png_quality** (Number)
189+
190+
Optional:
191+
192+
- **enabled** (Boolean)
193+
- **png_lossless** (Boolean)
194+
85195

0 commit comments

Comments
 (0)