Skip to content

Commit c423059

Browse files
committed
2 parents 4d1cac8 + af2b359 commit c423059

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,26 @@ find . \( -name \*.rs -o -name \*.tf -o -name \*.toml -o -name \*.md -o -name \*
3838
find . \( -name \*.rs -o -name \*.tf -o -name \*.toml -o -name \*.md -o -name \*.lock \) -exec sed -i '' "s#$TEMPLATE_NAME_SNAKE_CASE#$PROJECT_NAME#g" {} \;
3939
```
4040

41+
### Adding functionality
42+
43+
To create new Lambda functions, you can copy the `./src/bins/hello_world.rs` code to a new file in the same directory and modify the `function_handler` body with your desired functionality.
44+
Any new functions should be added as binaries in the `Cargo.toml` file, as follows:
45+
46+
```toml
47+
[[bin]]
48+
name = "<function_name>"
49+
path = "src/bins/<function_name>.rs"
50+
```
51+
52+
Any common code can be added to the library and split into modules just like in any other Cargo project.
53+
54+
For the infrastructure code, duplicate the code from the `./infrastructure/api.tf`, `./infrastructure/lambdas.tf`, and `./infrastructure/iam.tf` files, modifying the resource names and any fields referring to resource names. Any additional resources can be added to new files (e.g. `./infrastrucutre/s3.tf`).
55+
56+
4157
### Deployment
4258

59+
Before being able to deploy anything, you will need to **create the state bucket manually**. Use the bucket name from `./infrastructure/main.tf` or change it, if it's taken.
60+
4361
The recommended way for deploying the project is to use GitHub Actions; however, you can also do it from your local machine.
4462

4563
For deploying with GitHub Actions, push your project to a new repository, go to the repository's **Settings** -> **Secrets and variables** -> **Actions**, and add secrets for your IAM user credentials:

0 commit comments

Comments
 (0)