aws-toolkit-vscode | Local Lambda debug , SAM/CFN syntax | AWS library
kandi X-RAY | aws-toolkit-vscode Summary
kandi X-RAY | aws-toolkit-vscode Summary
The AWS Toolkit for Visual Studio Code is an extension for working with AWS services such as AWS Lambda. The Toolkit is available from the Visual Studio Marketplace. This is an open source project because we want you to be involved. We love issues, feature requests, code reviews, pull requests or any positive contribution. See CONTRIBUTING.md.
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 aws-toolkit-vscode
aws-toolkit-vscode Key Features
aws-toolkit-vscode Examples and Code Snippets
Community Discussions
Trending Discussions on aws-toolkit-vscode
QUESTION
Trying to install and configure AWS toolkit to Visual Studio Code.
Command Command palette->Create Credentials profile
brings two files :
ANSWER
Answered 2022-Feb-03 at 08:51You'll need to get the access and secret key from AWS and insert them in place of the XXXXXXX
placeholders.
You can get this information in the AWS Cloud -> IAM -> Access Management -> Users -> Select your user -> Security credentials -> Access Keys
You will find here the Access Key ID, but the Secret Key is only shown once when you are creating this item. You maybe have it stored somewhere, or you can create another Access Key pair and use that.
I have done this and I can connect to AWS Toolkit fine.
QUESTION
I have successfully been using AWS Toolkit to debug node.js lambda functions for a couple of years now. For my latest project I wanted to write my lambda functions in python. I have followed the directions in the tutorial below.
This tutorial really seems identical to what I have been doing to debug node.js. However, when I hit the "run and debug", I get this error.
2021-10-08 17:04:00 [INFO]: Running PythonPipBuilder:ResolveDependencies
2021-10-08 17:04:03 [INFO]: Build Failed
2021-10-08 17:04:04 [INFO]: Error: PythonPipBuilder:ResolveDependencies - {debugpy==1.5.0(wheel)}
2021-10-08 17:04:04 [WARN]: "sam build" failed: C:/path_to_user/AppData/Local/Temp/aws-toolkit-vscode/vsctkYP3zOS/app___vsctk___template.yaml
Obviously it's saying that it can't resolve debugpy but I am just beginning to use python and I am not sure what this is or how to resolve it. A google search didn't turn up anything that resolved the issue. If anyone could enlighten me, I'd really appreciate it
...ANSWER
Answered 2021-Oct-09 at 16:10One of the biggest advantages of Python is that lambda_handler functions are just another function in a python file. You can use Pytest and such to Unit Test the actual handler just like any other function without worrying about the Docker/SAM setup for the lambda.
Now, this is not perfect. Mocking a Context Object can be difficult if you are relying on it at all (If you aren't, passing an empty dict {}
to the second paramater is just fine) and its not exactly the same environment obviously. Imports can be different, as well as logging can be weird.
If you have SAM and Docker already, the mocking library moto can help with this, though it is also not perfect (and honestly, more for mocking lambda calls from within other functions than mocking the actual lambda)
As for your actual error and question...
Try removing the ==X.X.X from your requirements.txt and let pip try to get the latest - I know that isn't wonderful but it will let you know if that potential library for some reason is having trouble being pip installed into the docker container.
If that works, then it is likely a connection issue between your docker set up and pypy - you may have to modify your pip connection data to know where to look or to look somewhere specific.
QUESTION
I am trying to get local AWS Lambda development/debugging with Python3.8 working. I am using vscode and I have the AWS Toolkit extension enabled. It worked fine for the basic "hello world" lambda function that they give you. Now I want to modify the example to read some text from a file in S3, and when I try to debug it locally I get the error message "An error occurred (AccessDenied) when calling the GetObject operation: Access Denied"
but if I deploy the SAM application to AWS, it works fine in the actual AWS environment.
As far as I can tell, I added the S3ReadPolicy
correctly in the template.yaml
file, because (as stated) it works fine in AWS when it gets deployed - the role it creates has the S3 read permissions correctly added. But local runs crash and burn.
What am I doing wrong?
Here's the good results that I see when I test it on AWS after deploying it to AWS:
...ANSWER
Answered 2020-Oct-26 at 20:55As far as I know, the SAM functionality does not inherit the credentials profile that you set for the AWS Toolkit.
You can set the profile explicitly for SAM in your launch.json, for example:
QUESTION
I created a SAM application and want to debug it locally. The app has some dependencies which are specified in a Lambda Layer. This lambda layer is implemented and tested with other funtions - it runs ok.
I specified the need of this layer in templates.json
:
ANSWER
Answered 2020-Aug-18 at 12:17According to the docs,
Layers are extracted to the
/opt
directory in the function execution environment. Each runtime looks for libraries in a different location under/opt
, depending on the language. Structure your layer so that function code can access libraries without additional configuration.
You can try to simulate this locally with your docker image by mounting the content of your layer into the proper subfolder of /opt
. For Python, the right place to mount seems to be /opt/python
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install aws-toolkit-vscode
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