A dry run previews what an infrastructure change will do before it is applied. Its execution plan marks resources to create (+), modify (~), or destroy (-), giving reviewers a chance to catch dangerous changes before deployment. section 9.7.1
Spot the red flag
If a plan marks a production database for destruction, stop the deployment and investigate before applying the change. section 9.7.1
Listing 9.4 Terraform Execution Plan
Terraform will perform the following actions:
# aws_instance.web_server will be created
+ resource "aws_instance" "web_server" {
+ ami = "ami-0c55b159cbfafe1f0"
+ instance_type = "t3.micro"
}
# aws_security_group.firewall will be updated in-place
~ resource "aws_security_group" "firewall" {
~ description = "Allow web traffic" -> "Allow web and API traffic"
}
# aws_db_instance.primary_db will be destroyed
- resource "aws_db_instance" "primary_db" {
- engine = "postgres"
}
Plan: 1 to add, 1 to change, 1 to destroy.Compare the planned creation, update, and destruction in a sample Terraform execution plan. section 9.7.1



