-
Notifications
You must be signed in to change notification settings - Fork 636
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1865 from js0cha/fix-cloudflare-worker-upload
- Loading branch information
Showing
9 changed files
with
246 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:enhancement | ||
resource/cloudflare_worker: provide js module option to allow service bindings | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$ terraform import cloudflare_worker_script.example <script_name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
resource "cloudflare_workers_kv_namespace" "my_namespace" { | ||
title = "example" | ||
} | ||
|
||
# Sets the script with the name "script_1" | ||
resource "cloudflare_worker_script" "my_script" { | ||
name = "script_1" | ||
content = file("script.js") | ||
|
||
kv_namespace_binding { | ||
name = "MY_EXAMPLE_KV_NAMESPACE" | ||
namespace_id = cloudflare_workers_kv_namespace.my_namespace.id | ||
} | ||
|
||
plain_text_binding { | ||
name = "MY_EXAMPLE_PLAIN_TEXT" | ||
text = "foobar" | ||
} | ||
|
||
secret_text_binding { | ||
name = "MY_EXAMPLE_SECRET_TEXT" | ||
text = var.secret_foo_value | ||
} | ||
|
||
webassembly_binding { | ||
name = "MY_EXAMPLE_WASM" | ||
module = filebase64("example.wasm") | ||
} | ||
|
||
service_binding { | ||
name = "MY_SERVICE_BINDING" | ||
service = "MY_SERVICE" | ||
environment = "production" | ||
} | ||
|
||
r2_bucket_binding { | ||
name = "MY_BUCKET" | ||
bucket_name = "MY_BUCKET_NAME" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.