You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importpulumiimportlbrlabs_pulumi_scalewayasscaleway# Create a Scaleway resource (Object Bucket).bucket=scaleway.ObjectBucket("my-bucket")
# Export the name of the bucket.pulumi.export("bucket_name", bucket.id)
main_function_namespace=scaleway.FunctionNamespace("mainFunctionNamespace",
description="Main function namespace"
)
main_function=scaleway.Function("mainFunction",
namespace_id=main_function_namespace.id,
runtime="rust178",
handler="handle",
privacy="private")
I was able to deploy the bucket running pulumi up, now I wanted to test setting a basic function.
use hyper::{Body,Request,Response,StatusCode,};pubasyncfnhandle(_req:Request<Body>) -> Response<Body>{Response::builder().status(StatusCode::OK).header("Content-type","text/plain").body(Body::from("Hello from rust")).unwrap()}
The text was updated successfully, but these errors were encountered:
I have a minimal Pulumi project:
I was able to deploy the bucket running
pulumi up
, now I wanted to test setting a basic function.Following https://www.pulumi.com/registry/packages/scaleway/api-docs/function/ I added:
Updating a couple values to use a Rust handler.
This resulted in the output:
The Rust handler is in
handler.rs
as (copied from https://www.scaleway.com/en/docs/serverless/functions/reference-content/code-examples/#hello-world-in-rust):The text was updated successfully, but these errors were encountered: