@@ -68,7 +68,7 @@ func TestAccComputeBackendBucket_withCdnPolicy(t *testing.T) {
68
68
ImportStateVerify : true ,
69
69
},
70
70
{
71
- Config : testAccComputeBackendBucket_withCdnPolicy2 (backendName , storageName , 0 , 404 , 0 , 0 ),
71
+ Config : testAccComputeBackendBucket_withCdnPolicy2 (backendName , storageName , 0 , 404 , 86400 , 0 ),
72
72
},
73
73
{
74
74
ResourceName : "google_compute_backend_bucket.foobar" ,
@@ -83,6 +83,14 @@ func TestAccComputeBackendBucket_withCdnPolicy(t *testing.T) {
83
83
ImportState : true ,
84
84
ImportStateVerify : true ,
85
85
},
86
+ {
87
+ Config : testAccComputeBackendBucket_withCdnPolicy3 (backendName , storageName , 0 , 404 , 0 , 0 ),
88
+ },
89
+ {
90
+ ResourceName : "google_compute_backend_bucket.foobar" ,
91
+ ImportState : true ,
92
+ ImportStateVerify : true ,
93
+ },
86
94
},
87
95
})
88
96
}
@@ -165,3 +173,31 @@ resource "google_storage_bucket" "bucket" {
165
173
}
166
174
` , backendName , age , max_ttl , ttl , ttl , ttl , code , ttl , storageName )
167
175
}
176
+
177
+ func testAccComputeBackendBucket_withCdnPolicy3 (backendName , storageName string , age , code , max_ttl , ttl int ) string {
178
+ return fmt .Sprintf (`
179
+ resource "google_compute_backend_bucket" "foobar" {
180
+ name = "%s"
181
+ bucket_name = google_storage_bucket.bucket.name
182
+ enable_cdn = true
183
+ cdn_policy {
184
+ cache_mode = "FORCE_CACHE_ALL"
185
+ signed_url_cache_max_age_sec = %d
186
+ max_ttl = %d
187
+ default_ttl = %d
188
+ client_ttl = %d
189
+ serve_while_stale = %d
190
+ negative_caching_policy {
191
+ code = %d
192
+ ttl = %d
193
+ }
194
+ negative_caching = true
195
+ }
196
+ }
197
+
198
+ resource "google_storage_bucket" "bucket" {
199
+ name = "%s"
200
+ location = "EU"
201
+ }
202
+ ` , backendName , age , max_ttl , ttl , ttl , ttl , code , ttl , storageName )
203
+ }
0 commit comments