sam list endpoints - AWS Serverless Application Model

sam list endpoints

This page provides reference information for the AWS Serverless Application Model Command Line Interface (AWS SAM CLI) sam list endpoints subcommand.

For an introduction to the AWS SAM CLI, see What is the AWS SAM CLI?.

The sam list endpoints subcommand displays a list of cloud and local endpoints from your AWS CloudFormation stack. You can interact with these resources through the sam local and sam sync commands.

AWS Lambda and Amazon API Gateway resource types are supported with this command.

Note

Custom domains are supported when configured for your Amazon API Gateway resources. This command will output the custom domain instead of the default endpoint.

Usage

$ sam list endpoints <options>

Options

--config-env TEXT

The environment name specifying the default parameter values in the configuration file to use.

Default value: default

For more information about configuration files, see AWS SAM CLI configuration file.

--config-file TEXT

The path and file name of the configuration file containing default parameter values to use.

Default value: samconfig.toml in current working directory.

For more information about configuration files, see AWS SAM CLI configuration file.

--debug

Turn on debug logging to print debug messages generated by the AWS SAM CLI with timestamps.

--help, -h

Show this message and exit.

--output [json|table]

Specify the format to output results.

Default value: table

--profile TEXT

Select a specific profile from your credential file to get AWS credentials.

--region TEXT

Set the AWS region of the service. For example, us-east-1.

--save-params

Save the parameters that you provide at the command line to the AWS SAM configuration file.

--stack-name TEXT

Name of the deployed AWS CloudFormation stack. The stack name can be found in your application's samconfig.toml file or designated configuration file.

When this option is not specified, local resources defined in your template will display.

--template-file, --template, -t PATH

AWS SAM template file.

Default value: template.[yaml|yml|json]

Examples

Display an output, in json format, of deployed resource endpoints from your AWS CloudFormation stack named test-stack.

$ sam list endpoints --stack-name test-stack --output json [ { "LogicalResourceId": "HelloWorldFunction", "PhysicalResourceId": "sam-app-test-list-HelloWorldFunction-H85Y7yIV7ZLq", "CloudEndpoint": "https://zt55oi7kbljxjmcoahsj3cknwu0rposq.lambda-url.us-east-1.on.aws/", "Methods": "-" }, { "LogicalResourceId": "ServerlessRestApi", "PhysicalResourceId": "uj80uoe2o2", "CloudEndpoint": [ "https://uj80uoe2o2.execute-api.us-east-1.amazonaws.com/Prod", "https://uj80uoe2o2.execute-api.us-east-1.amazonaws.com/Stage" ], "Methods": [ "/hello['get']" ] } ]