

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# sam remote test-event put
<a name="sam-cli-command-reference-remote-test-event-put"></a>

本页提供 AWS Serverless Application Model 命令行界面 (AWS SAMCLI) `sam remote test-event put` 子命令的参考信息。
+ 有关简介 AWS SAMCLI，请参阅 [那是什么 AWS SAMCLI？](what-is-sam-overview.md#what-is-sam-cli)
+ 有关使用该 AWS SAMCLI`sam remote test-event`命令的文档，请参阅[使用 sam remote test-event 进行云测试简介](using-sam-cli-remote-test-event.md)。

该`sam remote test-event put`子命令将本地计算机上的可共享测试事件保存到 Amazon EventBridge 架构注册表中。

## 用法
<a name="sam-cli-command-reference-remote-test-event-put-usage"></a>

```
$ sam remote test-event put <arguments> <options>
```

## 参数
<a name="sam-cli-command-reference-remote-test-event-put-args"></a>

**Resource ID**  <a name="sam-cli-command-reference-remote-test-event-put-args-resource-id"></a>
与可共享测试事件关联的 AWS Lambda 函数的 ID。  
如果您提供逻辑 ID，则还必须使用选项为与 Lambda 函数关联的 AWS CloudFormation 堆栈提供一个值。`--stack-name`  
*有效值*：资源的逻辑 ID 或资源 ARN。

## 选项
<a name="sam-cli-command-reference-remote-test-event-put-options"></a>

`--config-env TEXT`  <a name="sam-cli-command-reference-remote-test-event-put-options-config-env"></a>
在配置文件中指定要使用的默认参数值的环境名称。默认值为“default”。有关配置文件的详细信息，请参阅 [AWS SAMCLI 配置文件](serverless-sam-cli-config.md)。

`--config-file PATH`  <a name="sam-cli-command-reference-remote-test-event-put-options-config-file"></a>
包含要使用的默认参数值的配置文件的路径和文件名。在项目目录的根目录中，默认值为“`samconfig.toml`”。有关配置文件的详细信息，请参阅 [AWS SAMCLI 配置文件](serverless-sam-cli-config.md)。

`--file FILENAME`  <a name="sam-cli-command-reference-remote-test-event-put-options-file"></a>
本地计算机上事件的文件路径和名称。  
提供 `-` 作为要从 `stdin` 处读取的文件名值。  
此选项是必需的。

`--force`, `-f`  <a name="sam-cli-command-reference-remote-test-event-put-options-force"></a>
覆盖同名的可共享测试事件。

`--help, -h`  <a name="sam-cli-command-reference-remote-test-event-put-options-help"></a>
显示帮助消息并退出。

`--name TEXT`  <a name="sam-cli-command-reference-remote-test-event-put-options-name"></a>
用于保存可共享测试事件的名称。  
如果 EventBridge 架构注册表中存在同名的可共享测试事件，则 AWS SAM CLI不会将其覆盖。若要覆盖，请添加 `--force` 选项。

`--output-file FILENAME`  <a name="sam-cli-command-reference-remote-test-event-put-options-output-file"></a>
在本地计算机上保存事件的文件路径和名称。  
如果您不提供此选项，则 AWS SAM CLI会将可共享测试事件的内容输出到您的主机。

`--stack-name TEXT`  <a name="sam-cli-command-reference-remote-test-event-put-options-stack-name"></a>
与 Lambda 函数关联的 CloudFormation 堆栈的名称。  
如果您提供 Lambda 函数逻辑 ID 作为参数，则此选项为必需。

## 示例
<a name="sam-cli-command-reference-remote-test-event-put-examples"></a>

有关使用此命令的示例，请参阅[保存可共享测试事件](using-sam-cli-remote-test-event.md#using-sam-cli-remote-test-event-use-put)。