Skip to content

Commit

Permalink
Add changelog and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
WalshyDev committed Apr 26, 2023
1 parent bc6564b commit 564c07d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/2399.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/cloudflare_pages_project: added secrets to Pages project. Secrets are encrypted environment variables, ideal for secrets such as API tokens. See documentation here: https://developers.cloudflare.com/pages/platform/functions/bindings/#secrets
```
9 changes: 9 additions & 0 deletions docs/resources/pages_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ resource "cloudflare_pages_project" "deployment_configs" {
environment_variables = {
ENVIRONMENT = "preview"
}
secrets = {
TURNSTILE_SECRET = var.turnstile_secret
}
kv_namespaces = {
KV_BINDING = "5eb63bbbe01eeed093cb22bb8f5acdc3"
}
Expand All @@ -88,6 +91,10 @@ resource "cloudflare_pages_project" "deployment_configs" {
ENVIRONMENT = "production"
OTHER_VALUE = "other value"
}
secrets = {
TURNSTILE_SECRET = var.turnstile_secret
TURNSTILE_INVIS_SECRET = var.turnstile_invisible_secret
}
kv_namespaces = {
KV_BINDING_1 = "5eb63bbbe01eeed093cb22bb8f5acdc3"
KV_BINDING_2 = "3cdca5f8bb22bc390deee10ebbb36be5"
Expand Down Expand Up @@ -167,6 +174,7 @@ Optional:
- `fail_open` (Boolean) Fail open used for Pages Functions. Defaults to `false`.
- `kv_namespaces` (Map of String) KV namespaces used for Pages Functions.
- `r2_buckets` (Map of String) R2 Buckets used for Pages Functions.
- `secrets` (Map of String) Encrypted environment variables for Pages Functions.
- `service_binding` (Block Set) Services used for Pages Functions. (see [below for nested schema](#nestedblock--deployment_configs--preview--service_binding))
- `usage_model` (String) Usage model used for Pages Functions. Defaults to `bundled`.

Expand Down Expand Up @@ -198,6 +206,7 @@ Optional:
- `fail_open` (Boolean) Fail open used for Pages Functions. Defaults to `false`.
- `kv_namespaces` (Map of String) KV namespaces used for Pages Functions.
- `r2_buckets` (Map of String) R2 Buckets used for Pages Functions.
- `secrets` (Map of String) Encrypted environment variables for Pages Functions.
- `service_binding` (Block Set) Services used for Pages Functions. (see [below for nested schema](#nestedblock--deployment_configs--production--service_binding))
- `usage_model` (String) Usage model used for Pages Functions. Defaults to `bundled`.

Expand Down
6 changes: 3 additions & 3 deletions examples/resources/cloudflare_pages_project/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ resource "cloudflare_pages_project" "deployment_configs" {
ENVIRONMENT = "preview"
}
secrets = {
TURNSTILE_SECRET = "1x0000000000000000000000000000000AA"
TURNSTILE_SECRET = var.turnstile_secret
}
kv_namespaces = {
KV_BINDING = "5eb63bbbe01eeed093cb22bb8f5acdc3"
Expand All @@ -74,8 +74,8 @@ resource "cloudflare_pages_project" "deployment_configs" {
OTHER_VALUE = "other value"
}
secrets = {
TURNSTILE_SECRET = "1x0000000000000000000000000000000AA"
TURNSTILE_INVIS_SECRET = "2x0000000000000000000000000000000AA"
TURNSTILE_SECRET = var.turnstile_secret
TURNSTILE_INVIS_SECRET = var.turnstile_invisible_secret
}
kv_namespaces = {
KV_BINDING_1 = "5eb63bbbe01eeed093cb22bb8f5acdc3"
Expand Down

0 comments on commit 564c07d

Please sign in to comment.