sam list stack-outputs - Amazon Serverless Application Model
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

sam list stack-outputs

此页面提供了 Amazon Serverless Application Model 命令行界面 (Amazon SAM CLI) sam list stack-outputs 子命令的参考信息。

有关 Amazon SAM CLI 的简介,请参阅 那是什么 Amazon SAMCLI?

sam list stack-outputs 子命令显示来自 Amazon Serverless Application Model (Amazon SAM) 或 Amazon CloudFormation 模板的 Amazon CloudFormation 堆栈输出。有关 Outputs 的更多信息,请参阅《Amazon CloudFormation 用户指南》中的输出

使用量

$ sam list stack-outputs <options>

Options

--config-env TEXT

在配置文件中指定要使用的默认参数值的环境名称。

默认值default

有关配置文件的详细信息,请参阅 Amazon SAMCLI 配置文件

--config-file TEXT

包含要使用的默认参数值的配置文件的路径和文件名。

默认值:当前工作目录中 samconfig.toml

有关配置文件的详细信息,请参阅 Amazon SAMCLI 配置文件

--debug

启用调试日志记录,以打印由 Amazon SAM CLI 生成的带有时间戳的调试消息。

--help, -h

显示此消息并退出。

--output [json|table]

指定输出结果的格式。

默认值table

--profile TEXT

从凭证文件中选择一个特定的配置文件以获取 Amazon 凭证。

--region TEXT

设置服务的 Amazon 区域。例如,us-east-1

--save-params

将您在命令行中提供的参数保存到 Amazon SAM 配置文件中。

--stack-name TEXT

已部署的 Amazon CloudFormation 堆栈的名称。可在应用程序的 samconfig.toml 文件或指定的配置文件中找到堆栈名称。

此选项是必需的。

示例

以表格格式显示名为 test-stack 的 Amazon CloudFormation 堆栈中资源的输出。

$ sam list stack-outputs --stack-name test-stack --output table ------------------------------------------------------------------------------------------------------------------------ OutputKey OutputValue Description ------------------------------------------------------------------------------------------------------------------------ HelloWorldFunctionIamRole arn:aws:iam::account-number:role/sam- Implicit IAM Role created for Hello app-test-list-HelloWorldFunctionRole- World function SRJDMJ6F7F41 HelloWorldApi https://uj80uoe2o2.execute-api.us- API Gateway endpoint URL for Prod east-1.amazonaws.com/Prod/hello/ stage for Hello World function HelloWorldFunction arn:aws:lambda:us- Hello World Lambda Function ARN east-1:account-number:function:sam-app- test-list- HelloWorldFunction-H85Y7yIV7ZLq ------------------------------------------------------------------------------------------------------------------------