This example demonstrates how to package in an WebAssembly module that uses the developer preview version of the AWS SDK for Rust.
- Show functions (ListFunctions)
-
You must have an AWS account, and have configured your default credentials and AWS Region as described in https://github.com/awslabs/aws-sdk-rust.
-
Install the latest stable version of Node.js.
-
Install wasm-pack.
Your must customize your AWS credentials in the file www/env/credentials.js. Otherwise, it will not make the request to the backend.
This example lists your Lambda functions and returns the total amount found in a certain Region.
wasm-pack build --target web --out-dir www/pkg --dev
From within the www directory, run the following command to install project and start serving.
npm ci
npm start
Access your page at http://localhost:3000
. Make your selection and press Run
:
- region is the Region in which the client is created. If not supplied, defaults to us-west-2.
- verbose displays additional information.
To propose a new code example to the AWS documentation team, see CONTRIBUTING.md. The team prefers to create code examples that show broad scenarios rather than individual API calls.
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0