New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --auto-approve args to apply #4

wants to merge 1 commit into
base: master
File filter...
Filter file types
Jump to file or symbol
Failed to load files and symbols.
+1 −0
Diff settings


Just for now

Add --auto-approve args to apply

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
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[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
[1m[31mError: [0m[0m[1mApply cancelled.[0m

FATAL: java.lang.Exception: Terraform Apply failed: 1
	at org.jenkinsci.plugins.terraform.TerraformBuildWrapper.executeApply(
	at org.jenkinsci.plugins.terraform.TerraformBuildWrapper.setUp(
	at hudson.model.Build$BuildExecution.doRun(
	at hudson.model.AbstractBuild$
	at hudson.model.Run.execute(
	at hudson.model.ResourceController.execute(

Finished: FAILURE
  • Loading branch information...
ptkimball committed Mar 8, 2018
commit 47d6d3da54dd2cc437c1efb5df89cdccdb0f3eb0
@@ -234,6 +234,7 @@ public void executeApply(AbstractBuild build, final Launcher launcher, final Bui


if (!isNullOrEmpty(getVariables())) {
ProTip! Use n and p to navigate between commits in a pull request.