深入理解 Terraform:资源清理与状态管理
1. Terraform 资源清理
当你完成 Terraform 的实验后,为避免 AWS 产生不必要的费用,建议移除所有创建的资源。由于 Terraform 会跟踪你创建的资源,清理操作十分简单,只需运行 destroy 命令:
$ terraform destroy
运行该命令后,Terraform 会列出即将销毁的资源,例如:
Terraform will perform the following actions:
# aws_autoscaling_group.example will be destroyed
- resource "aws_autoscaling_group" "example" {
(...)
}
# aws_launch_configuration.example will be destroyed
- resource "aws_launch_configuration" "example" {
(...)
}
# aws_lb.example will be destroyed
- resource "aws_lb" "example" {
(...)
}
(...)
Plan: 0 to add, 0 to change, 8 to destroy.
Do you really want to destroy al
超级会员免费看
订阅专栏 解锁全文
16

被折叠的 条评论
为什么被折叠?



