Skip to content

Commit 43177b1

Browse files
committed
Change handler and redeploy
1 parent 725675f commit 43177b1

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

functions/php-s3/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ tf-plan:
1414
.PHONY: tf-apply
1515
tf-apply: zip
1616
cd terraform && terraform apply -auto-approve -var-file=vars/main.tfvars
17+
18+
.PHONY: tf-destroy
19+
tf-destroy:
20+
cd terraform && terraform destroy -var-file=vars/main.tfvars

functions/php-s3/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,5 @@ This will template a script, `curl.sh` which you can run to call your function:
5252
```
5353

5454
You can then check [your `php-s3-example` bucket](https://console.scaleway.com/object-storage/buckets/fr-par/php-s3-example/explorer) to see the key that was written by your function.
55+
56+
You will also see the S3 response printed in the function logs.

functions/php-s3/function/handler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require __DIR__ . "/vendor/autoload.php";
44

5-
function handle($event, $context)
5+
function run($event, $context)
66
{
77
// Get values from function environment variables
88
$s3_access_key = getenv('S3_ACCESS_KEY');

functions/php-s3/terraform/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ resource "scaleway_function" "php_function" {
5050
description = "PHP example working with S3"
5151
namespace_id = scaleway_function_namespace.function_ns.id
5252
runtime = "php82"
53-
handler = "handler.handle"
53+
handler = "handler.run"
5454
min_scale = 0
5555
max_scale = 2
5656
zip_file = "../function/function.zip"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
project_id = "<your project ID>"
1+
project_id = "46bd4c91-ec86-4656-b17b-83de2d1b61ec"

0 commit comments

Comments
 (0)