AWS Blogs 07月18日 01:38
Simplify serverless development with console to IDE and remote debugging for AWS Lambda
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

AWS Lambda 近期推出了两项重要更新:控制台到 IDE 集成和远程调试,旨在大幅提升开发者在本地开发和调试无服务器应用程序的效率。这些新功能建立在先前对 Lambda 开发体验的改进之上,使开发者能够更流畅地将云端函数迁移至本地 IDE 进行编辑和调试,并直接在云端环境中进行远程调试,从而有效缩短开发周期,减少对本地模拟的依赖,优化整体开发流程。新集成功能适用于所有 Lambda 运行时,远程调试初期支持 Python、Node.js 和 Java。

💡 **控制台到 IDE 集成:** 引入了“在 Visual Studio Code 中打开”按钮,允许开发者一键将 AWS Lambda 控制台中的函数代码同步到 VS Code 中进行编辑。此功能会自动检查并引导安装必要的 AWS Toolkit for VS Code,并处理复杂的本地开发环境配置,让开发者能快速进入代码编写和修改,修改后可直接部署回 Lambda。

💻 **全面的本地开发环境:** 集成到 VS Code 后,开发者不仅能编辑代码,还能利用 IDE 的完整功能,如集成终端进行包管理(npm install, pip install)、运行测试、使用 Linter 和 Formatter 等,极大地增强了本地开发能力,提供比控制台更强大的开发体验。

☁️ **远程调试能力:** 开发者可以直接从 VS Code 调试部署在 AWS 账户中的 Lambda 函数。这项功能允许在云端环境中进行调试,能够完全访问 VPC 资源和 IAM 角色,解决了本地模拟与云端执行环境的差异问题,尤其在调试与 RDS 等服务交互的函数时,能显著加快问题定位和解决速度。

🚀 **优化开发工作流:** 控制台到 IDE 集成与远程调试协同工作,创建了一个无缝的开发流程:从控制台快速切换到 VS Code,再到云端进行远程调试。这消除了在不同工具和环境间切换的繁琐,帮助开发者更快地发现和修复问题,提升了整体开发效率。

✅ **易于上手与成本效益:** 这些新功能均免费提供,开发者只需支付标准的 Lambda 执行费用。控制台到 IDE 集成支持所有 Lambda 运行时,而远程调试初期覆盖 Python、Node.js 和 Java,并将逐步扩展到更多运行时。用户只需更新 AWS Toolkit for VS Code 至最新版本即可使用。

<section class="blog-post-content lb-rtxt"><table id="amazon-polly-audio-table"><tbody><tr><td id="amazon-polly-audio-tab"><p></p></td></tr></tbody></table><p>Today, we’re announcing two significant enhancements to <a href="https://aws.amazon.com/lambda&quot;&gt;AWS Lambda</a> that make it easier than ever for developers to build and debug serverless applications in their local development environments: console to IDE integration and remote debugging. These new capabilities build upon our recent improvements to the Lambda development experience, including the <a href="https://aws.amazon.com/blogs/compute/introducing-an-enhanced-in-console-editing-experience-for-aws-lambda/&quot;&gt;enhanced in-console editing experience</a> and the <a href="https://aws.amazon.com/blogs/compute/introducing-an-enhanced-local-ide-experience-for-aws-lambda-developers/&quot;&gt;improved local integrated development environment (IDE) experience</a> launched in late 2024.</p><p>When building serverless applications, developers typically focus on two areas to streamline their workflow: local development environment setup and cloud debugging capabilities. While developers can bring functions from the console to their IDE, they’re looking for ways to make this process more efficient. Additionally, as functions interact with various AWS services in the cloud, developers want enhanced debugging capabilities to identify and resolve issues earlier in the development cycle, reducing their reliance on local emulation and helping them optimize their development workflow.</p><p><strong>Console to IDE integration</strong></p><p>To address the first challenge, we’re introducing console to IDE integration, which streamlines the workflow from the <a href="https://aws.amazon.com/console/&quot;&gt;AWS Management Console</a> to <a href="https://code.visualstudio.com/&quot;&gt;Visual Studio Code (VS Code)</a>. This new capability adds an <strong>Open in Visual Studio Code</strong> button to the Lambda console, enabling developers to quickly move from viewing their function in the browser to editing it in their IDE, eliminating the time-consuming setup process for local development environments.</p><p>The console to IDE integration automatically handles the setup process, checking for VS Code installation and the <a href="https://aws.amazon.com/visualstudiocode/&quot;&gt;AWS Toolkit for VS Code</a>. For developers that have everything already configured, choosing the button immediately opens their function code in VS Code, so they can continue editing and deploy changes back to Lambda in seconds. If VS Code isn’t installed, it directs developers to the download page, and if the AWS Toolkit is missing, it prompts for installation.</p><p>To use console to IDE, look for the <strong>Open in VS Code</strong> button in either the Getting Started popup after creating a new function or the <strong>Code</strong> tab of existing Lambda functions. After selecting, VS Code opens automatically (installing AWS Toolkit if needed). Unlike the console environment, you now have access to a full development environment with integrated terminal – a significant improvement for developers who need to manage packages (npm install, pip install), run tests, or use development tools like linters and formatters. You can edit code, add new files/folders, and any changes you make will trigger an automatic deploy prompt. When you choose to deploy, the AWS Toolkit automatically deploys your function to your AWS account.</p><p><img class="alignnone size-large wp-image-97330" src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2025/06/18/console-to-ide-01-1024x683.png&quot; alt="Screenshot showing Console to IDE" width="1024" height="683" /></p><p><strong>Remote debugging</strong></p><p>Once developers have their functions in their IDE, they can use remote debugging to debug Lambda functions deployed in their AWS account directly from VS Code. The key benefit of remote debugging is that it allows developers to debug functions running in the cloud while integrated with other AWS services, enabling faster and more reliable development.</p><p>With remote debugging, developers can debug their functions with complete access to <a href="https://aws.amazon.com/vpc/&quot;&gt;Amazon Virtual Private Cloud (VPC)</a> resources and <a href="https://aws.amazon.com/iam/&quot;&gt;AWS Identity and Access Management (AWS IAM)</a> roles, eliminating the gap between local development and cloud execution. For example, when debugging a Lambda function that interacts with an <a href="https://aws.amazon.com/rds/&quot;&gt;Amazon Relational Database Service (Amazon RDS)</a> database in a VPC, developers can now debug the <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html&quot;&gt;execution environment</a> of the function running in the cloud within seconds, rather than spending time setting up a local environment that might not match production.</p><p>Getting started with remote debugging is straightforward. Developers can select a Lambda function in VS Code and enable debugging in seconds. AWS Toolkit for VS Code automatically downloads the function code, establishes a secure debugging connection, and enables breakpoint setting. When debugging is complete, AWS Toolkit for VS Code automatically cleans up the debugging configuration to prevent any impact on production traffic.</p><p><strong>Let’s try it out</strong></p><p>To take remote debugging for a spin, I chose to start with a basic “hello world” example function, written in Python. I had previously created the function using the <a href="https://console.aws.amazon.com/&quot;&gt;AWS Management Console</a> for AWS Lambda. Using the AWS Toolkit for VS Code, I can navigate to my function in the <strong>Explorer</strong> pane. Hovering over my function, I can right-click (ctrl-click in Windows) to download the code to my local machine to edit the code in my IDE. Saving the file will ask me to decide if I want to deploy the latest changes to Lambda.</p><p><img class="alignnone size-large wp-image-97324" src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2025/06/18/lambda-debug-01-1024x679.png&quot; alt="Screenshot view of the Lambda Debugger in VS Code" width="1024" height="679" /></p><p>From here, I can select the play icon to open the <strong>Remote invoke configuration</strong> page for my function. This dialog will now display a <strong>Remote debugging</strong> option, which I configure to point at my local copy of my function handler code. Before choosing <strong>Remote invoke</strong>, I can set breakpoints on the left anywhere I want my code to pause for inspection.</p><p><img class="alignnone size-large wp-image-97325" src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2025/06/18/lambda-debug-02-1024x680.png&quot; alt="" width="1024" height="680" /></p><p>My code will be running in the cloud after it’s invoked, and I can monitor its status in real time in VS Code. In the following screenshot, you can see I’ve set a breakpoint at the print statement. My function will pause execution at this point in my code, and I can inspect things like local variable values before either continuing to the next breakpoint or stepping into the code line by line.</p><p><img class="alignnone size-large wp-image-97326" src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2025/06/18/lambda-debug-03-1024x681.png&quot; alt="" width="1024" height="681" /></p><p>Here, you can see that I’ve chosen to step into the code, and as I go through it line by line, I can see the context and local and global variables displayed on the left side of the IDE. Additionally, I can follow the logs in the <strong>Output</strong> tab at the bottom of the IDE. As I step through, I’ll see any log messages or output messages from the execution of my function in real time.</p><p><img class="alignnone size-large wp-image-97327" src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2025/06/18/lambda-debug-04-1024x680.png&quot; alt="" width="1024" height="680" /></p><p><strong>Enhanced development workflow</strong></p><p>These new capabilities work together to create a more streamlined development experience. Developers can start in the console, quickly transition to VS Code using the console to IDE integration, and then use remote debugging to debug their functions running in the cloud. This workflow eliminates the need to switch between multiple tools and environments, helping developers identify and fix issues faster.</p><p>Console to IDE is available for all Lambda runtimes, at no additional cost. Remote debugging will support Python, Node.js, and Java runtimes at launch, with plans to expand support to additional runtimes in the future. Remote debugging is available at no additional cost—you pay only for the standard Lambda execution costs during debugging sessions.</p><p><strong>Now available</strong></p><p>You can start using these new features through the AWS Management Console and VS Code with the AWS Toolkit for VS Code (v3.69.0 or later) installed. Console to IDE integration is available in all commercial <a href="https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/&quot;&gt;AWS Regions</a> where Lambda is available, except AWS GovCloud (US) Regions. Learn more about it in <a href="https://docs.aws.amazon.com/lambda/latest/dg/foundation-iac-local-development.html&quot;&gt;Lambda&lt;/a&gt; and <a href="https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/lambda-console-ide.html&quot;&gt;AWS Toolkit for VS Code</a> documentation. To learn more about remote debugging capability, including AWS Regions it is available in, visit the <a href="https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/lambda-remote-debug.html&quot;&gt;AWS Toolkit for VS Code</a> and <a href="https://docs.aws.amazon.com/lambda/latest/dg/troubleshooting-execution.html#troubleshooting-execution-remote-debugging&quot;&gt;Lambda&lt;/a&gt; documentation.</p><p>These enhancements represent a significant step forward in simplifying the serverless development experience, which means developers can build and debug Lambda functions more efficiently than ever before.</p></section><aside id="Comments" class="blog-comments"><div data-lb-comp="aws-blog:cosmic-comments" data-env="prod" data-content-id="9f2f8ca1-3c38-49d9-8f13-cf818d0f1165" data-title="Simplify serverless development with console to IDE and remote debugging for AWS Lambda" data-url="https://aws.amazon.com/blogs/aws/simplify-serverless-development-with-console-to-ide-and-remote-debugging-for-aws-lambda/&quot;&gt;&lt;p data-failed-message="Comments cannot be loaded… Please refresh and try again.">Loading comments…</p></div></aside>

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

AWS Lambda 无服务器开发 IDE集成 远程调试 VS Code
相关文章