Skip to content

Commit

Permalink
add python code type
Browse files Browse the repository at this point in the history
  • Loading branch information
dfangl committed Oct 6, 2021
1 parent d0a18f3 commit d0b6107
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ The Lambda runtime in LocalStack uses patched AWS SDKs, which are configured to
This behavior is enabled by default for most Lambda runtimes when using LocalStack Pro.

Assuming you had a Python Lambda handler that attempts to list all S3 buckets. In the past, you had to manually configure the `endpoint_url` parameter on the boto3 client (and potentially use environment switches for dev/prod in your test code):
```
```python
import boto3
def handler(event, context):
client = boto3.client("s3", endpoint_url="http://localhost:4566")
print(client.list_buckets())
```

With the patched AWS SDKs, it now becomes possible to deploy your unmodified production code to LocalStack, simply creating a boto3 client with default settings. The invocations of the boto3 client will be automatically forwarded to the local APIs:
```
```python
import boto3
def handler(event, context):
client = boto3.client("s3")
Expand Down

0 comments on commit d0b6107

Please sign in to comment.