Skip to content

Commit 761fa5c

Browse files
committed
Update docs
1 parent c00170c commit 761fa5c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,31 @@ You can find a more complete project structure in the [rust-workspaces/] CDK sam
179179
180180
[workspaces]: https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html
181181
[rust-workspaces/]: https://github.com/rnag/rust.aws-cdk-lambda/tree/main/cdk-examples/rust-workspaces
182+
183+
## Rust Function Properties
184+
185+
Below lists some commonly used properties you can pass in to the `RustFunction` construct.
186+
187+
| Name | Description |
188+
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
189+
| `target` | Build target to cross-compile to. Defaults to the target for Linux MUSL, `x86_64-unknown-linux-musl`. |
190+
| `directory` | Entry point where the project's main `Cargo.toml` is located. By default, the construct will use directory where `cdk` was invoked as the directory where Cargo files are located. |
191+
| `buildDir` | Default Build directory, which defaults to a `.build` folder under the project's root directory. |
192+
| `bin` | Executable name to pass to `--bin` |
193+
| `package` | Workspace package name to pass to `--package` |
194+
| `setupLogging` | Determines whether we want to set up [library logging](https://rust-lang-nursery.github.io/rust-cookbook/development_tools/debugging/config_log.html) - i.e. set the `RUST_LOG` environment variable - for the lambda function. |
195+
196+
## Settings
197+
198+
Settings can be imported as follows:
199+
200+
```ts
201+
import { Settings } from 'rust.aws-cdk-lambda';
202+
```
203+
204+
Below are some useful _global_ defaults which can be set for all Rust Lambda Functions in a CDK app.
205+
206+
| name | description |
207+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
208+
| `BUILD_INDIVIDUALLY` | Whether to build each executable individually, either via `--bin` or `--package`. |
209+
| `workspace_dir` | Sets the root workspace directory. By default, the workspace directory is assumed to be the directory where `cdk` was invoked.<br><br>This directory should contain at the minimum a `Cargo.toml` file which defines the workspace members. |

0 commit comments

Comments
 (0)