

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# sam list stack-outputs
<a name="sam-cli-command-reference-sam-list-stack-outputs"></a>

此頁面提供 AWS Serverless Application Model 命令列界面 (AWS SAM CLI) `sam list stack-outputs`子命令的參考資訊。

如需 的簡介 AWS SAM CLI，請參閱 [什麼是 AWS SAM CLI？](what-is-sam-overview.md#what-is-sam-cli)

`sam list stack-outputs` 子命令會顯示來自 AWS Serverless Application Model (AWS SAM) 或 CloudFormation 範本的 AWS CloudFormation 堆疊輸出。如需 的詳細資訊`Outputs`，請參閱*AWS CloudFormation 《 使用者指南*》中的[輸出](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html)。

## Usage
<a name="sam-cli-command-reference-sam-list-stack-outputs-usage"></a>

```
$ sam list stack-outputs <options>
```

## 選項
<a name="sam-cli-command-reference-sam-list-stack-outputs-options"></a>

`--config-env TEXT`  <a name="sam-cli-command-reference-sam-list-stack-outputs-options-config-env"></a>
在要使用的組態檔案中指定預設參數值的環境名稱。  
*預設值*：`default`  
如需關於組態檔案的詳細資訊，請參閱 [AWS SAM CLI 組態檔案](serverless-sam-cli-config.md)。

`--config-file TEXT`  <a name="sam-cli-command-reference-sam-list-stack-outputs-options-config-file"></a>
組態檔案的路徑和檔案名稱，其中包含要使用的預設參數值。  
*預設值*：`samconfig.toml`在目前的工作目錄中。  
如需關於組態檔案的詳細資訊，請參閱 [AWS SAM CLI 組態檔案](serverless-sam-cli-config.md)。

`--debug`  <a name="sam-cli-command-reference-sam-list-stack-outputs-options-debug"></a>
開啟偵錯記錄，以列印由具有時間戳記的 AWS SAM CLI產生的偵錯訊息。

`--help, -h`  <a name="sam-cli-command-reference-sam-list-stack-outputs-options-help"></a>
顯示此訊息並結束。

`--output [json|table]`  <a name="sam-cli-command-reference-sam-list-stack-outputs-options-output"></a>
指定輸出結果的格式。  
*預設值*：`table`

`--profile TEXT`  <a name="sam-cli-command-reference-sam-list-stack-outputs-options-profile"></a>
從登入資料檔案選取特定設定檔以取得 AWS 登入資料。

`--region TEXT`  <a name="sam-cli-command-reference-sam-list-stack-outputs-options-region"></a>
設定服務 AWS 的區域。例如 `us-east-1`。

`--save-params`  <a name="sam-cli-command-reference-sam-list-stack-outputs-options-save-params"></a>
將您在命令列提供的參數儲存至 AWS SAM 組態檔案。

`--stack-name TEXT`  <a name="sam-cli-command-reference-sam-list-stack-outputs-options-"></a>
部署堆疊的名稱 CloudFormation 。您可以在應用程式的 `samconfig.toml` 檔案或指定的組態檔案中找到堆疊名稱。  
此選項為必要。

## 範例
<a name="sam-cli-command-reference-sam-list-stack-outputs-examples"></a>

以資料表格式顯示 CloudFormation 堆疊中名為 之資源的輸出`test-stack`。

```
$ 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
------------------------------------------------------------------------------------------------------------------------
```