Fix for `terraform apply` defaulting to interactive mode.
Started by user ptkimball
[EnvInject] - Loading node environment variables.
Building on master in workspace /var/lib/jenkins/workspace/Terraform PoC
[terraform-plugin] $ /var/lib/jenkins/tools/org.jenkinsci.plugins.terraform.TerraformInstallation/Terraform_0.11.3/terraform get
[terraform-plugin] $ /var/lib/jenkins/tools/org.jenkinsci.plugins.terraform.TerraformInstallation/Terraform_0.11.3/terraform apply -input=false "-state=/var/lib/jenkins/workspace/Terraform PoC/terraform-plugin/terraform-plugin.tfstate"
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
[32m+[0m create
[0m
Terraform will perform the following actions:
[32m [32m+[0m [32maws_instance.example
[0m id: <computed>
ami: "ami-12345678"
associate_public_ip_address: <computed>
availability_zone: <computed>
ebs_block_device.#: <computed>
ephemeral_block_device.#: <computed>
instance_state: <computed>
instance_type: "t2.nano"
ipv6_address_count: <computed>
ipv6_addresses.#: <computed>
key_name: <computed>
network_interface.#: <computed>
network_interface_id: <computed>
placement_group: <computed>
primary_network_interface_id: <computed>
private_dns: <computed>
private_ip: <computed>
public_dns: <computed>
public_ip: <computed>
root_block_device.#: <computed>
security_groups.#: <computed>
source_dest_check: "true"
subnet_id: "subnet-87654321"
tenancy: <computed>
volume_tags.%: <computed>
vpc_security_group_ids.#: <computed>
[0m
[0m
[0m[1mPlan:[0m 1 to add, 0 to change, 0 to destroy.[0m
[0m[1mDo you want to perform these actions?[0m
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
[1mEnter a value:[0m [0m
[31m
[1m[31mError: [0m[0m[1mApply cancelled.[0m
[0m[0m[0m
FATAL: java.lang.Exception: Terraform Apply failed: 1
at org.jenkinsci.plugins.terraform.TerraformBuildWrapper.executeApply(TerraformBuildWrapper.java:249)
at org.jenkinsci.plugins.terraform.TerraformBuildWrapper.setUp(TerraformBuildWrapper.java:269)
at hudson.model.Build$BuildExecution.doRun(Build.java:157)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1724)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE