[英]How do I destroy a aws SAM Local lambda?
按照阅读的示例阅读它说:
# AWS SAM Hello World Example #
A simple AWS SAM template that specifies a single Lambda function.
## Usage ##
To create and deploy the SAM Hello World example, first ensure that you've met the requirements described in the [root README](../../README.md). Then
follow the steps below.
### Test your application locally ###
Use [SAM Local](https://github.com/awslabs/aws-sam-local) to run your Lambda function locally:
sam local invoke "HelloWorldFunction" -e event.json
### Package artifacts ###
Run the following command, replacing `BUCKET-NAME` with the name of your bucket:
sam package --template-file template.yaml --s3-bucket BUCKET-NAME --output-template-file packaged-template.yaml
This creates a new template file, packaged-template.yaml, that you will use to deploy your serverless application.
### Deploy to AWS CloudFormation ###
Run the following command, replacing `MY-NEW-STACK` with a name for your CloudFormation stack.
sam deploy --template-file packaged-template.yaml --stack-name MY-NEW-STACK --capabilities CAPABILITY_IAM
This uploads your template to an S3 bucket and deploys the specified resources using AWS CloudFormation.
现在删除整个堆栈(包括 s3 存储桶和 CF 堆栈)的 sam local 命令是什么?
2022年编辑:
Sam cli 现在有一个delete
命令,可以在这里查看官方文档。 现在应该可以这样运行了:
sam delete --stack-name MY-NEW-STACK
感谢@jesusnoseq 提供更新的指针🍻。
旧版 2018 答案
目前没有 sam 命令可以删除所有这些资源。 您只需使用相关的 aws cli 命令,无论如何 sam-cli 只是一个包装器。 删除 CFN 堆栈的示例。
aws cloudformation delete-stack --stack-name MY-NEW-STACK
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.