-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathresource.tf
More file actions
66 lines (60 loc) · 1.72 KB
/
resource.tf
File metadata and controls
66 lines (60 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
resource "stackit_cdn_distribution" "example_distribution" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
config = {
backend = {
type = "http"
origin_url = "https://mybackend.onstackit.cloud"
geofencing = {
"https://mybackend.onstackit.cloud" = ["DE"]
}
}
regions = ["EU", "US", "ASIA", "AF", "SA"]
blocked_countries = ["DE", "AT", "CH"]
optimizer = {
enabled = true
}
}
}
resource "stackit_cdn_distribution" "example_bucket_distribution" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
config = {
backend = {
type = "bucket"
bucket_url = "https://my-test.object.storage.eu01.onstackit.cloud"
region = "eu01"
# Credentials are required for bucket backends
# It is strongly recommended to use variables for secrets
credentials = {
access_key_id = var.bucket_access_key
secret_access_key = var.bucket_secret_key
}
}
regions = ["EU", "US"]
blocked_countries = ["CN", "RU"]
optimizer = {
enabled = false
}
redirects = {
rules = [
{
description = "test redirect"
enabled = true
rule_match_condition = "ANY"
status_code = 302
target_url = "https://stackit.de/"
matchers = [
{
values = ["*/otherPath/"]
value_match_condition = "ANY"
}
]
}
]
}
}
}
# Only use the import statement, if you want to import an existing cdn distribution
import {
to = stackit_cdn_distribution.import-example
id = "${var.project_id},${var.distribution_id}"
}