Complete the code to initialize Terraform before running tests.
terraform [1]Terraform must be initialized with terraform init to download providers and set up the working directory before testing.
Complete the code to create a Terraform plan file for integration testing.
terraform [1] -out=tfplanThe terraform plan command creates an execution plan and saves it to a file for review or testing.
Fix the error in the command to apply a saved Terraform plan during integration testing.
terraform [1] tfplanTo apply a saved plan file, use terraform apply tfplan. Using 'plan' or 'init' here is incorrect.
Fill both blanks to write a Terraform test block that checks if a resource attribute equals a value.
test "resource_attribute" { check "state_check" { assert { condition = [1] == [2] } } }
The test checks if the instance state equals "running" using the correct resource attribute.
Fill all three blanks to create a Terraform output that shows the public IP of an instance after integration testing.
output "instance_ip" { value = [1].[2].[3] }
The output accesses the public IP attribute of the example AWS instance resource.