1) Terraform Taint



terraform taint aws_instance.webserver
Bạn có thể untaint

terraform untaint aws_instance.webserver
2) Debugging
Chúng ta có nhiều levels về log debug


Bạn cũng có thể output debug ra file.

3) Terraform Import

Có nhứng resource A bạn tạo bằng web console
Có những resource B bạn tạo bằng ansible
Và sau đó đọc các bài post của Nimtechnology thì bạn bắt đầu sử dụng terraform.
Vậy câu hỏi làm sao chúng ta có thể bằng các resource A và B vào terraform?
Các đầu tiên ta sử dụng datasource để lấy được data của resource:

Ví dụ mình muốn lấy IP public của 1 VM mà trước đó mình tạo bằng web console
Các thứ 2:
Sử dụng terraform import

Nó bảo bạn tạo 1 block resource với data rỗng

xong bạn chạy command import.



Cho dù bạn chạy terraform plam thì nó cũng ko thấy thay đổi gì?
Difference between terraform import and terraform data
Vì terraform data nó chỉ get data và sử dụng cho lần running đó
terraform import ==> từ 1 resource được tạo manual –>Bạn import data vào trong terraformtf.state -> tạo terraform resource.