This repository was archived by the owner on Mar 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +112
-1
lines changed Expand file tree Collapse file tree 3 files changed +112
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ resource "gcore_cdn_resource" "cdn_example_com" {
17
17
secondary_hostnames = [" cdn2.example.com" ]
18
18
19
19
options {
20
+ edge_cache_settings {
21
+ default = " 8d"
22
+ }
20
23
browser_cache_settings {
21
24
value = " 1d"
22
25
}
Original file line number Diff line number Diff line change @@ -17,14 +17,29 @@ resource "gcore_cdn_rule" "cdn_example_com_rule_1" {
17
17
18
18
options {
19
19
edge_cache_settings {
20
- default = " 4d"
20
+ default = " 14d"
21
+ }
22
+ browser_cache_settings {
23
+ value = " 14d"
21
24
}
22
25
redirect_http_to_https {
23
26
value = true
24
27
}
25
28
gzip_on {
26
29
value = true
27
30
}
31
+ cors {
32
+ value = [
33
+ " *"
34
+ ]
35
+ }
36
+ rewrite {
37
+ body = " /(.*) /$1"
38
+ }
39
+ webp {
40
+ jpg_quality = 55
41
+ png_quality = 66
42
+ }
28
43
}
29
44
}
30
45
Original file line number Diff line number Diff line change @@ -76,6 +76,27 @@ func resourceCDNRule() *schema.Resource {
76
76
},
77
77
},
78
78
},
79
+ "browser_cache_settings" : {
80
+ Type : schema .TypeList ,
81
+ MaxItems : 1 ,
82
+ Optional : true ,
83
+ Computed : true ,
84
+ Description : "" ,
85
+ Elem : & schema.Resource {
86
+ Schema : map [string ]* schema.Schema {
87
+ "enabled" : {
88
+ Type : schema .TypeBool ,
89
+ Optional : true ,
90
+ Default : true ,
91
+ },
92
+ "value" : {
93
+ Type : schema .TypeString ,
94
+ Optional : true ,
95
+ Description : "" ,
96
+ },
97
+ },
98
+ },
99
+ },
79
100
"host_header" : {
80
101
Type : schema .TypeList ,
81
102
MaxItems : 1 ,
@@ -132,6 +153,78 @@ func resourceCDNRule() *schema.Resource {
132
153
},
133
154
},
134
155
},
156
+ "cors" : {
157
+ Type : schema .TypeList ,
158
+ MaxItems : 1 ,
159
+ Optional : true ,
160
+ Description : "" ,
161
+ Elem : & schema.Resource {
162
+ Schema : map [string ]* schema.Schema {
163
+ "enabled" : {
164
+ Type : schema .TypeBool ,
165
+ Optional : true ,
166
+ Default : true ,
167
+ },
168
+ "value" : {
169
+ Type : schema .TypeSet ,
170
+ Elem : & schema.Schema {Type : schema .TypeString },
171
+ Required : true ,
172
+ },
173
+ },
174
+ },
175
+ },
176
+ "rewrite" : {
177
+ Type : schema .TypeList ,
178
+ MaxItems : 1 ,
179
+ Optional : true ,
180
+ Description : "" ,
181
+ Elem : & schema.Resource {
182
+ Schema : map [string ]* schema.Schema {
183
+ "enabled" : {
184
+ Type : schema .TypeBool ,
185
+ Optional : true ,
186
+ Default : true ,
187
+ },
188
+ "body" : {
189
+ Type : schema .TypeString ,
190
+ Required : true ,
191
+ },
192
+ "flag" : {
193
+ Type : schema .TypeString ,
194
+ Optional : true ,
195
+ Default : "break" ,
196
+ },
197
+ },
198
+ },
199
+ },
200
+ "webp" : {
201
+ Type : schema .TypeList ,
202
+ MaxItems : 1 ,
203
+ Optional : true ,
204
+ Description : "" ,
205
+ Elem : & schema.Resource {
206
+ Schema : map [string ]* schema.Schema {
207
+ "enabled" : {
208
+ Type : schema .TypeBool ,
209
+ Optional : true ,
210
+ Default : true ,
211
+ },
212
+ "jpg_quality" : {
213
+ Type : schema .TypeInt ,
214
+ Required : true ,
215
+ },
216
+ "png_quality" : {
217
+ Type : schema .TypeInt ,
218
+ Required : true ,
219
+ },
220
+ "png_lossless" : {
221
+ Type : schema .TypeBool ,
222
+ Optional : true ,
223
+ Default : false ,
224
+ },
225
+ },
226
+ },
227
+ },
135
228
},
136
229
},
137
230
},
You can’t perform that action at this time.
0 commit comments