Skip to content

Commit 35d1860

Browse files
authored
Fix environment variables upload (#751)
* Fix environment variables upload * Update main.tf * Update main.tf
1 parent 4d8e325 commit 35d1860

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

.terraform/main.tf

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,42 @@ resource "cloudflare_pages_project" "dispoflare_pages_project" {
4848

4949
deployment_configs = {
5050
production = {
51-
environment_variables = {
52-
CLOUDFLARE_ACCOUNT_ID = sensitive(var.cloudflare_account_id)
53-
CLOUDFLARE_API_TOKEN = sensitive(var.cloudflare_api_token)
54-
SENTRY_DSN = sensitive(var.sentry_dsn)
51+
env_vars = {
52+
CLOUDFLARE_ACCOUNT_ID = {
53+
type = "plain_text"
54+
value = sensitive(var.cloudflare_account_id)
55+
}
56+
CLOUDFLARE_API_TOKEN = {
57+
type = "plain_text"
58+
value = sensitive(var.cloudflare_api_token)
59+
}
60+
SENTRY_DSN = {
61+
type = "plain_text"
62+
value = sensitive(try(var.sentry_dsn, ""))
63+
}
5564
}
5665

5766
kv_namespaces = {
5867
KV_SETTINGS = {
5968
namespace_id = sensitive(cloudflare_workers_kv_namespace.dispoflare_production_settings.id)
6069
}
6170
}
62-
63-
compatibility_date = "2023-02-25"
6471
}
6572

6673
preview = {
67-
environment_variables = {
68-
CLOUDFLARE_ACCOUNT_ID = sensitive(var.cloudflare_account_id)
69-
CLOUDFLARE_API_TOKEN = sensitive(var.cloudflare_api_token)
70-
SENTRY_DSN = sensitive(var.sentry_dsn)
74+
env_vars = {
75+
CLOUDFLARE_ACCOUNT_ID = {
76+
type = "plain_text"
77+
value = sensitive(var.cloudflare_account_id)
78+
}
79+
CLOUDFLARE_API_TOKEN = {
80+
type = "plain_text"
81+
value = sensitive(var.cloudflare_api_token)
82+
}
83+
SENTRY_DSN = {
84+
type = "plain_text"
85+
value = sensitive(try(var.sentry_dsn, ""))
86+
}
7187
}
7288

7389
kv_namespaces = {

0 commit comments

Comments
 (0)