

# “运行/调试配置”对话框
<a name="run-debug-configurations-dialog"></a>

无论您想在本地、远程还是 Amazon Elastic Container Service（Amazon ECS）集群中更改运行/调试配置，AWS Toolkit for JetBrains 中都会显示**运行/调试配置**对话框。

**Topics**
+ [“运行/调试配置”对话框（本地函数设置）](run-debug-configurations-dialog-local.md)
+ [“运行/调试配置”对话框（远程函数设置）](run-debug-configurations-dialog-remote.md)
+ [“编辑配置”对话框（Amazon ECS 集群）](edit-configuration-dialog-ecs.md)

# “运行/调试配置”对话框（本地函数设置）
<a name="run-debug-configurations-dialog-local"></a>

每当您更新 AWS Lambda 函数*本地*版本的设置时，都会显示此对话框。

**注意**  
要更新该函数（该函数的源代码位于 AWS 账户的 Lambda 中）的*远程*版本设置，请改为参阅[“运行/调试配置”对话框（远程函数设置）](run-debug-configurations-dialog-remote.md)。

此对话框包含 3 个选项卡：**配置**、**SAM CLI** 和 **AWS 连接**。

![\[本地函数设置的“运行/调试配置”对话框的“配置”选项卡。\]](http://docs.aws.amazon.com/zh_cn/toolkit-for-jetbrains/latest/userguide/images/sam-run-debug-config-zip.png)


本地函数设置的**运行/调试配置**对话框的**配置**选项卡包含以下项：

**名称**  
（必需）此配置的名称。

**允许并行运行/允许以并行方式运行 **  
（可选）如果选择此项，则允许 IntelliJ IDEA、PyCharm、WebStorm 或 JetBrains Rider 根据需要启动任意数量的配置实例以并行运行。1

**来自处理程序/来自模板**  
（必需）根据选择的选项，您必须配置其他设置。

**运行时系统**  
（必需）要使用的 [Lambda 运行时系统](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)的 ID。

**处理程序**  
（**来自处理程序**选项为必需）[Java](https://docs.aws.amazon.com/lambda/latest/dg/java-handler.html)、[Python](https://docs.aws.amazon.com/lambda/latest/dg/python-handler.html)、[Node.js](https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html) 或 [C\$1](https://docs.aws.amazon.com/lambda/latest/dg/csharp-handler.html) 的相应函数处理程序的标识符。

**超时（秒）**  
（**来自处理程序**选项为必需）Lambda 在停止函数前允许其运行的时长。指定最多 900 秒（15 分钟）的时长。

**内存 (MB)**  
（**来自处理程序**选项为必需）函数运行时可用的内存量。指定[介于 128 MB 和 3008 MB](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html)之间的量，以 64 MB 为增量。

**环境变量**  
（**来自处理程序**的选项为必需）Lambda 函数要使用的任何[环境变量](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)，指定为键值对。要添加、更改或删除环境变量，请选择文件夹图标，然后按照屏幕上的说明执行操作。

**模板**  
（**来自模板**的选项为必需）用于此配置的 AWS Serverless Application Model（AWS SAM）模板（例如 `template.yaml`）的位置和文件名，以及该模板中与此配置关联的资源。

**文件**  
（必需）要传递给函数的事件数据的位置和文件名（JSON 格式）。有关事件数据示例，请参阅《AWS Lambda 开发人员指南》**中的 [Invoke the Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually) 和《AWS Serverless Application Model 开发人员指南》**中的 [Generating sample event payloads](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-generate-event.html)。

**文本**  
（必需）要传递给函数的事件数据（JSON 格式）。有关事件数据示例，请参阅《AWS Lambda 开发人员指南》**中的 [Invoke the Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually) 和《AWS Serverless Application Model 开发人员指南》**中的 [Generating sample event payloads](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-generate-event.html)。  
**文件**或**文本**为必需（而不是都为必需）。

**启动前：窗口**  
（可选）列出在启动此配置前必须执行的任务。2

***备注***  
1有关更多信息，请参阅以下内容：  
+ 有关 IntelliJ IDEA，请参阅 IntelliJ IDEA 帮助网站上的[常用选项](https://www.jetbrains.com/help/idea/run-debug-configurations-dialog.html#common)。
+ 有关 PyCharm，请参阅 PyCharm 帮助网站上的[常用选项](https://www.jetbrains.com/help/pycharm/run-debug-configurations-dialog.html#common)。
+ 有关 WebStorm，请参阅 WebStorm 帮助网站上的[常用选项](https://www.jetbrains.com/help/webstorm/run-debug-configuration-node-js.html#common)。
+ 有关 JetBrains Rider，请参阅 JetBrains Rider 帮助网站上的[常用选项](https://www.jetbrains.com/help/rider/Run_Debug_Configurations_dialog.html#common)。
2有关更多信息，请参阅以下内容：  
+ 有关 IntelliJ IDEA，请参阅 IntelliJ IDEA 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/idea/run-debug-configurations-dialog.html#before-launch-options)。
+ 有关 PyCharm，请参阅 PyCharm 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/pycharm/run-debug-configurations-dialog.html#before-launch-options)。
+ 有关 WebStorm，请参阅 WebStorm 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/webstorm/run-debug-configuration-node-js.html#before-launch-options)。
+ 有关 JetBrains Rider，请参阅 JetBrains Rider 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/rider/Run_Debug_Configurations_dialog.html#before-launch-options)。

![\[本地函数设置的“运行/调试配置”对话框的 SAM CLI 选项卡。\]](http://docs.aws.amazon.com/zh_cn/toolkit-for-jetbrains/latest/userguide/images/sam-run-debug-cli.png)


本地函数设置的**运行/调试配置**对话框的 **SAM CLI** 选项卡包含以下项：

**名称**  
（必需）此配置的名称。

**允许并行运行/允许以并行方式运行**  
（可选）如果选择此项，则允许 IntelliJ IDEA、PyCharm、WebStorm 或 JetBrains Rider 根据需要启动任意数量的配置实例以并行运行。1

**在容器内构建函数**  
（可选）如果选择此项，AWS SAM CLI 会在部署之前在类似 Lambda 的 Docker 容器中本地构建无服务器应用程序的任意函数。如果函数依赖于具有本地编译的依赖关系或程序的程序包，这会很有用。有关更多信息，请参阅 *AWS Serverless Application Model 开发人员指南*中的[构建应用程序](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html)。

**跳过检查较新的容器映像**  
（可选）如果选择此项，AWS SAM CLI 将跳过下拉**配置**选项卡上指定的[运行时系统](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)的最新 Docker 映像。

**Docker 网络**  
（可选）Lambda Docker 容器要连接到的现有 Docker 网络的名称或 ID，以及默认桥接网络。如果未指定此项，Lambda 容器将仅连接到默认的桥接 Docker 网络。

**启动前：窗口**  
（可选）列出在启动此配置前必须执行的任务。2

***备注***  
1有关更多信息，请参阅以下内容：  
+ 有关 IntelliJ IDEA，请参阅 IntelliJ IDEA 帮助网站上的[常用选项](https://www.jetbrains.com/help/idea/run-debug-configurations-dialog.html#common)。
+ 有关 PyCharm，请参阅 PyCharm 帮助网站上的[常用选项](https://www.jetbrains.com/help/pycharm/run-debug-configurations-dialog.html#common)。
+ 有关 WebStorm，请参阅 WebStorm 帮助网站上的[常用选项](https://www.jetbrains.com/help/webstorm/run-debug-configuration-node-js.html#common)。
+ 有关 JetBrains Rider，请参阅 JetBrains Rider 帮助网站上的[常用选项](https://www.jetbrains.com/help/rider/Run_Debug_Configurations_dialog.html#common)。
2有关更多信息，请参阅以下内容：  
+ 有关 IntelliJ IDEA，请参阅 IntelliJ IDEA 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/idea/run-debug-configurations-dialog.html#before-launch-options)。
+ 有关 PyCharm，请参阅 PyCharm 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/pycharm/run-debug-configurations-dialog.html#before-launch-options)。
+ 有关 WebStorm，请参阅 WebStorm 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/webstorm/run-debug-configuration-node-js.html#before-launch-options)。
+ 有关 JetBrains Rider，请参阅 JetBrains Rider 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/rider/Run_Debug_Configurations_dialog.html#before-launch-options)。

![\[本地函数设置的“运行/调试配置”对话框的“AWS 连接”选项卡。\]](http://docs.aws.amazon.com/zh_cn/toolkit-for-jetbrains/latest/userguide/images/sam-run-debug-aws-connection.png)


本地函数设置的**运行/调试配置**对话框的 **AWS 连接**选项卡包含以下项：

**凭证**  
（必需）要使用的现有 AWS 账户连接的名称。

**区域**  
（必需）要用于已连接账户的 AWS 区域名称。

***备注***  
1有关更多信息，请参阅以下内容：  
+ 有关 IntelliJ IDEA，请参阅 IntelliJ IDEA 帮助网站上的[常用选项](https://www.jetbrains.com/help/idea/run-debug-configurations-dialog.html#common)。
+ 有关 PyCharm，请参阅 PyCharm 帮助网站上的[常用选项](https://www.jetbrains.com/help/pycharm/run-debug-configurations-dialog.html#common)。
+ 有关 WebStorm，请参阅 WebStorm 帮助网站上的[常用选项](https://www.jetbrains.com/help/webstorm/run-debug-configuration-node-js.html#common)。
+ 有关 JetBrains Rider，请参阅 JetBrains Rider 帮助网站上的[常用选项](https://www.jetbrains.com/help/rider/Run_Debug_Configurations_dialog.html#common)。
2有关更多信息，请参阅以下内容：  
+ 有关 IntelliJ IDEA，请参阅 IntelliJ IDEA 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/idea/run-debug-configurations-dialog.html#before-launch-options)。
+ 有关 PyCharm，请参阅 PyCharm 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/pycharm/run-debug-configurations-dialog.html#before-launch-options)。
+ 有关 WebStorm，请参阅 WebStorm 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/webstorm/run-debug-configuration-node-js.html#before-launch-options)。
+ 有关 JetBrains Rider，请参阅 JetBrains Rider 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/rider/Run_Debug_Configurations_dialog.html#before-launch-options)。

# “运行/调试配置”对话框（远程函数设置）
<a name="run-debug-configurations-dialog-remote"></a>

每当您更新 AWS Lambda 函数（该函数的源代码位于 AWS 账户的 Lambda 中）*远程*版本的设置时，都会显示此对话框。

**注意**  
要更新该函数*本地*版本的设置，请改为参阅[“运行/调试配置”对话框（本地函数设置）](run-debug-configurations-dialog-local.md)。  
虽然对话框的名称是**运行/调试配置**，但您不能使用 AWS Toolkit for JetBrains 调试 Lambda 函数的远程版本。您只能运行此函数。

![\[远程函数设置的“运行/调试配置”对话框。\]](http://docs.aws.amazon.com/zh_cn/toolkit-for-jetbrains/latest/userguide/images/run-debug-configurations-dialog-remote.png)


远程函数设置的**运行/调试配置**对话框包含以下项：

**名称**  
（必需）此配置的名称。

**共享/通过 VCS 共享**  
（可选）如果选择此选项，则其他团队成员也能使用此配置。1

**允许并行运行/允许以并行方式运行 **  
（可选）如果选择此项，则允许 IntelliJ IDEA、PyCharm、WebStorm 或 JetBrains Rider 根据需要启动任意数量的配置实例以并行运行。1

**凭证**  
（必需）要使用的现有 AWS 账户连接的名称。

**区域**  
（必需）要用于已连接账户的 AWS 区域名称。

**函数**  
（必需）要使用的 Lambda 函数名称。

**文件**  
（必需）要传递给函数的事件数据的位置和文件名（JSON 格式）。有关事件数据示例，请参阅《AWS Lambda 开发人员指南》**中的 [Invoke the Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually) 和《AWS Serverless Application Model 开发人员指南》**中的 [Generating sample event payloads](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-generate-event.html)。

**文本**  
（必需）要传递给函数的事件数据（JSON 格式）。有关事件数据示例，请参阅《AWS Lambda 开发人员指南》**中的 [Invoke the Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually) 和《AWS Serverless Application Model 开发人员指南》**中的 [Generating sample event payloads](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-generate-event.html)。

**注意**  
**文件**或**文本**为必需（而不是都为必需）。

**启动前：激活工具窗口**  
（可选）列出在启动此配置前必须执行的任务。2

**显示此页面**  
（可选）如果选择此项，则会在启动此配置之前显示这些配置设置。2

**激活工具窗口**  
（可选）如果选择此项，则会在启动此配置时打开**运行**或**调试**工具窗口。2

***备注***  
1有关更多信息，请参阅以下内容：  
+ 有关 IntelliJ IDEA，请参阅 IntelliJ IDEA 帮助网站上的[常用选项](https://www.jetbrains.com/help/idea/run-debug-configurations-dialog.html#common)。
+ 有关 PyCharm，请参阅 PyCharm 帮助网站上的[常用选项](https://www.jetbrains.com/help/pycharm/run-debug-configurations-dialog.html#common)。
+ 有关 WebStorm，请参阅 WebStorm 帮助网站上的[常用选项](https://www.jetbrains.com/help/webstorm/run-debug-configuration-node-js.html#common)。
+ 有关 JetBrains Rider，请参阅 JetBrains Rider 帮助网站上的[常用选项](https://www.jetbrains.com/help/rider/Run_Debug_Configurations_dialog.html#common)。
2有关更多信息，请参阅以下内容：  
+ 有关 IntelliJ IDEA，请参阅 IntelliJ IDEA 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/idea/run-debug-configurations-dialog.html#before-launch-options)。
+ 有关 PyCharm，请参阅 PyCharm 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/pycharm/run-debug-configurations-dialog.html#before-launch-options)。
+ 有关 WebStorm，请参阅 WebStorm 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/webstorm/run-debug-configuration-node-js.html#before-launch-options)。
+ 有关 JetBrains Rider，请参阅 JetBrains Rider 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/rider/Run_Debug_Configurations_dialog.html#before-launch-options)。

# “编辑配置”对话框（Amazon ECS 集群）
<a name="edit-configuration-dialog-ecs"></a>

**编辑配置**对话框包含两个选项卡：**配置**和 **AWS 连接**。

![\[“编辑配置”对话框的“配置”选项卡。\]](http://docs.aws.amazon.com/zh_cn/toolkit-for-jetbrains/latest/userguide/images/edit-configuration-dialog-ecs-configuration.png)


**编辑配置**对话框的**配置**选项卡包含以下项：

**名称**  
（必需）此配置的名称。

**共享/通过 VCS 共享**  
（可选）如果选择此选项，则其他团队成员也能使用此配置。1

**允许并行运行/允许以并行方式运行**  
（可选）如果选择此项，则允许 IntelliJ IDEA、PyCharm、WebStorm 或 JetBrains Rider 根据需要启动任意数量的配置实例以并行运行。1

**集群**  
（必需）要调试的 Amazon Elastic Container Service（Amazon ECS）集群的名称。

**服务**  
（必需）要调试的集群中的 Amazon ECS 服务名称。

**添加容器**  
向此配置添加容器。可选（如果至少一个选项卡已可见）。每个选项卡均代表一个单独的容器。  
以下项目适用于所选容器：**Platform (平台)**、**Remote Debug Port (远程调试端口)**、**Start Command (启动命令)**、**Artifacts Mappings (构件映射)** 和 **Port Mappings (端口映射)**。

**平台**  
（必需）要使用的调试平台。

**远程调试端口**  
（可选）要附加到调试程序的端口。通常，除非服务使用端口 20020-20030，否则不应指定此项。如果没有使用，请在此处指定端口，以便容器不会尝试绑定可能在其他位置使用的端口。

**启动命令**  
（必需）用于启动程序以便调试程序可以附加到程序的命令。对于 Java，它应以 `java` 开头，且不包含调试程序信息（例如 `-Xdebug`）。对于 Python，它必须以 `python`、`python2` 或 `python3` 开头，后跟要运行的文件的路径和名称。

**构件映射**  
（必需）映射到容器内**远程路径**的本地开发计算机上的**本地路径**。必须映射计划要运行的所有代码和构件。要指定本地和远程路径映射，请选择 **Add (添加)**（**\$1** 图标）。

**端口映射**  
（可选）映射到容器内**远程端口**的本地开发计算机上的**本地端口**。这支持本地端口直接与远程资源上的端口进行通信。例如，对于命令 `curl localhost:3422`，端口 `3422` 将映射到某项服务。要指定本地和远程端口映射，请选择 **Add (添加)**（**\$1** 图标）。

**启动前：激活工具窗口**  
（可选）列出在启动此配置前必须执行的任务。2

**显示此页面**  
（可选）如果选择此项，则会在启动此配置之前显示这些配置设置。2

**激活工具窗口**  
（可选）如果选择此项，则会在启动此配置时打开**运行**或**调试**工具窗口。2

***备注***  
1有关更多信息，请参阅以下内容：  
+ 有关 IntelliJ IDEA，请参阅 IntelliJ IDEA 帮助网站上的[常用选项](https://www.jetbrains.com/help/idea/run-debug-configurations-dialog.html#common)。
+ 有关 PyCharm，请参阅 PyCharm 帮助网站上的[常用选项](https://www.jetbrains.com/help/pycharm/run-debug-configurations-dialog.html#common)。
+ 有关 WebStorm，请参阅 WebStorm 帮助网站上的[常用选项](https://www.jetbrains.com/help/webstorm/run-debug-configuration-node-js.html#common)。
+ 有关 JetBrains Rider，请参阅 JetBrains Rider 帮助网站上的[常用选项](https://www.jetbrains.com/help/rider/Run_Debug_Configurations_dialog.html#common)。
2有关更多信息，请参阅以下内容：  
+ 有关 IntelliJ IDEA，请参阅 IntelliJ IDEA 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/idea/run-debug-configurations-dialog.html#before-launch-options)。
+ 有关 PyCharm，请参阅 PyCharm 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/pycharm/run-debug-configurations-dialog.html#before-launch-options)。
+ 有关 WebStorm，请参阅 WebStorm 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/webstorm/run-debug-configuration-node-js.html#before-launch-options)。
+ 有关 JetBrains Rider，请参阅 JetBrains Rider 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/rider/Run_Debug_Configurations_dialog.html#before-launch-options)。

![\[“编辑配置”对话框的“AWS 连接”选项卡。\]](http://docs.aws.amazon.com/zh_cn/toolkit-for-jetbrains/latest/userguide/images/edit-configuration-dialog-ecs-aws-connection.png)


**编辑配置**对话框的 **AWS 连接**选项卡包含以下项：

**名称**  
（必需）此配置的名称。

**凭证**  
（必需）要使用的现有 AWS 账户连接的名称。

**区域**  
（必需）要用于已连接账户的 AWS 区域名称。

**共享/通过 VCS 共享**  
（可选）如果选择此选项，则其他团队成员也能使用此配置。1

**允许并行运行/允许以并行方式运行**  
（可选）如果选择此项，则允许 IntelliJ IDEA、PyCharm、WebStorm 或 JetBrains Rider 根据需要启动任意数量的配置实例以并行运行。1

**启动前：激活工具窗口**  
（可选）列出在启动此配置前必须执行的任务。2

**显示此页面**  
（可选）如果选择此项，则会在启动此配置之前显示这些配置设置。2

**激活工具窗口**  
（可选）如果选择此项，则会在启动此配置时打开**运行**或**调试**工具窗口。2

***备注***  
1有关更多信息，请参阅以下内容：  
+ 有关 IntelliJ IDEA，请参阅 IntelliJ IDEA 帮助网站上的[常用选项](https://www.jetbrains.com/help/idea/run-debug-configurations-dialog.html#common)。
+ 有关 PyCharm，请参阅 PyCharm 帮助网站上的[常用选项](https://www.jetbrains.com/help/pycharm/run-debug-configurations-dialog.html#common)。
+ 有关 WebStorm，请参阅 WebStorm 帮助网站上的[常用选项](https://www.jetbrains.com/help/webstorm/run-debug-configuration-node-js.html#common)。
+ 有关 JetBrains Rider，请参阅 JetBrains Rider 帮助网站上的[常用选项](https://www.jetbrains.com/help/rider/Run_Debug_Configurations_dialog.html#common)。
2有关更多信息，请参阅以下内容：  
+ 有关 IntelliJ IDEA，请参阅 IntelliJ IDEA 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/idea/run-debug-configurations-dialog.html#before-launch-options)。
+ 有关 PyCharm，请参阅 PyCharm 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/pycharm/run-debug-configurations-dialog.html#before-launch-options)。
+ 有关 WebStorm，请参阅 WebStorm 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/webstorm/run-debug-configuration-node-js.html#before-launch-options)。
+ 有关 JetBrains Rider，请参阅 JetBrains Rider 帮助网站上的 [Before Launch options](https://www.jetbrains.com/help/rider/Run_Debug_Configurations_dialog.html#before-launch-options)。