lambda-local | Commandline tool to run Amazon Lambda function | Cloud Functions library
kandi X-RAY | lambda-local Summary
kandi X-RAY | lambda-local Summary
Commandline tool to run Amazon Lambda function on local machines.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of lambda-local
lambda-local Key Features
lambda-local Examples and Code Snippets
npm install lambda-local -g
C:\Users\[youruser]\AppData\Roaming\npm\
Community Discussions
Trending Discussions on lambda-local
QUESTION
I am trying to use aws sam to invoke my lambda function locally for testing. The function reads an item from a dynamodb table. I have spin up a local dynamodb container where the desired table is created.
Ran below commands to create a local dynamodb container.
- docker network create lambda-local
- docker run —-network=lambda-local —-name users -d -p 8000:8000 amazon/dynamodb-local
- aws dynamodb create-table --table-name employees --attribute-definitions AttributeName=name,AttributeType=S --key-schema AttributeName=name,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 --endpoint-url=http://127.0.0.1:8000
Then using below command I am able to verify that all is working fine as far as local dynamodb is concerned.
- aws dynamodb list-tables --endpoint-url http://localhsot:8000
But then, when I try to run the below command, I get an error.
...ANSWER
Answered 2021-Oct-27 at 08:36You need to have the access and secret key configured along with the region in your local machine using the AWS CLI. This error is raised because of either not having correct access and secret keys or not having it configured.
Refer the below link for reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html
QUESTION
I am running a Node(12.x) Lambda in AWS. The purpose of this lambda is to interact with Cloudformation stacks, and I'm doing that via the aws-sdk. When testing this lambda locally using lambda-local
, it executes successfully and the stack can be seen in CREATING
state in AWS console.
However, when I push and run this lambda in AWS, it fails after 15 seconds, and I get this error:
ANSWER
Answered 2020-Jun-29 at 04:14Lambda function in a VPC does not public IP address nor internet access. From docs:
Connect your function to private subnets to access private resources. If your function needs internet access, use NAT. Connecting a function to a public subnet does not give it internet access or a public IP address.
There are two common solutions for that:
- place lambda function in a private subnet and setup NAT gateway in public subnet. Then set route table from private subnet to the NAT device. This will enable the lambda to access the internet and subsequently CloudFormation service.
- setup a VPC interface endpoint for CloudFormation. This will allow your lambda function in private subnet to access CloudFormation without the internet.
QUESTION
I am trying to perform a table creation using pyodbc on a SQL Server 2017 database hosted using Docker. I'm also using a network so that I can connect to it later from another Docker image. However, I get the following error
...ANSWER
Answered 2020-Feb-14 at 09:10In your docker run
command you specify -p 7000:7000
. This translates in "map the host port 7000 (first 7000 - published) to the container port 7000 (the second 7000 - exposed)". If you have MSSQL running on a different port inside your container (which probably you do) then you have to change that second 7000 to the correct port.
Once you do that you should be able to connect to MSSQL from host using "localhost:7000". This applies if your python application runs directly on host.
If your python project also runs in a container, you need to make sure it runs on the same network as the mssql container (--network=lambda-local-mssql
) and then you need to connect using "mssqldocker:mssql_exposed_port". In this case localhost and 7000 (the first part of `-p 7000:...) are not valide anymore since you are on a docker managed network.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install lambda-local
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page