@goldstack/utils-aws-lambda 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
1
|
# Goldstack AWS Lambda Tools
|
|
2
2
|
|
|
3
|
-
This library provides a simple wrapper around the AWS CLI to deploy Lambdas.
|
|
3
|
+
This library provides a simple wrapper around the AWS CLI to deploy Lambdas and define Lambda infrastructure.
|
|
4
|
+
|
|
5
|
+
## deployFunction
|
|
6
|
+
|
|
7
|
+
This function will deploy an AWS lambda. Note this function will either need Docker to be available locally or the AWS cli.
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
interface DeployFunctionParams {
|
|
11
|
+
lambdaPackageDir: string;
|
|
12
|
+
targetArchiveName?: string;
|
|
13
|
+
awsCredentials: AWS.Credentials;
|
|
14
|
+
region: string;
|
|
15
|
+
functionName: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function async deployFunction(
|
|
19
|
+
params: DeployFunctionParams
|
|
20
|
+
): Promise<any> {}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## readLambdaConfig
|
|
24
|
+
|
|
25
|
+
This function will generate a configuration for AWS HTTP API Gateway based on `.ts` files in a folder. For more information, see [Goldstack Documentation - Defining Routes](https://docs.goldstack.party/docs/modules/lambda-api#defining-routes-1)
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
export interface LambdaConfig {
|
|
29
|
+
name: string;
|
|
30
|
+
type: RouteType;
|
|
31
|
+
absoluteFilePath: string;
|
|
32
|
+
relativeFilePath: string;
|
|
33
|
+
path: string;
|
|
34
|
+
route: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function readLambdaConfig(dir: string): LambdaConfig[] {}
|
|
38
|
+
```
|