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
Package the Lambda function and its dependencies into a ZIP file. Run the following command:
127
127
128
-
{{< command >}}
129
-
$ mkdir -p build
130
-
$ cp -r libs/* build/
131
-
$ (cd build && zip -q -r function-py.zip .)
132
-
{{< / command >}}
128
+
```bash
129
+
mkdir -p build
130
+
cp -r libs/* build/
131
+
(cd build && zip -q -r function-py.zip .)
132
+
```
133
133
134
134
You have now created a ZIP file named `function-py.zip` that contains the Lambda function and its dependencies.
135
135
136
136
## Start the LocalStack container
137
137
138
138
Start your LocalStack container in your preferred terminal/shell.
139
139
140
-
{{< command >}}
141
-
$ export LOCALSTACK_AUTH_TOKEN=<your_auth_token>
142
-
$ DEBUG=1 \
140
+
```bash
141
+
export LOCALSTACK_AUTH_TOKEN=<your_auth_token>
142
+
DEBUG=1 \
143
143
LAMBDA_RUNTIME_ENVIRONMENT_TIMEOUT=180 \
144
144
IMAGE_NAME=localstack/snowflake \
145
145
localstack start
146
-
{{< / command >}}
146
+
```
147
147
148
148
> The `DEBUG=1` environment variable is set to enable debug logs. It would allow you to see the SQL queries executed by the Lambda function. The `LAMBDA_RUNTIME_ENVIRONMENT_TIMEOUT` environment variable is set to increase the Lambda function's timeout to 180 seconds.
149
149
150
150
## Deploy the Lambda function
151
151
152
152
You can now deploy the Lambda function to LocalStack using the `awslocal` CLI. Run the following command:
After successfully deploying the Lambda function, you will receive a response with the details of the function. You can now invoke the function using the `awslocal` CLI:
You will receive a response with the details of the invocation. You can view the output in the `output.txt` file. To see the SQL queries executed by the Lambda function, check the logs by navigating to LocalStack logs (`localstack logs`).
You can now perform further experimentations with the Snowflake emulator. For example, you can use the Snowpark API to run queries to get various insights, such as determining the range of loans per different category.
162
+
You can now perform further experimentations with the Snowflake emulator. For example, you can use the Snowpark API to run queries to get various insights, such as determining the range of loans per different category.
0 commit comments