Difference between revisions of "Terraform apply"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
 
(47 intermediate revisions by 6 users not shown)
Line 1: Line 1:
  [[terraform]] apply
+
{{lowercase}}
 +
* https://www.terraform.io/docs/cli/commands/apply.html
 +
  {{terraform flow}}
 +
== Options ==
 +
* <code>[[terraform]] apply</code>
 +
* <code>[[terraform apply --help]]</code>
 +
* <code>[[terraform apply -auto-approve]]</code>
 +
* <code>[[terraform apply -refresh-only]]</code>
 +
* <code>terraform apply [[-var]]="[[image_id]]=ami-abc123"</code>
 +
* <code>terraform apply [[-var]]="[[image_id]]=ami-abc123 [[-var]]="your_second_var=yourvalue"</code>
 +
* <code>terraform apply [[-var-file]]="your_file[[.tfvars]]"</code>
 +
* <code>[[terraform apply -destroy]]</code>
 +
* <code>[[terraform apply -replace]]="aws_instance.example[0]"</code>
  
terraform apply
+
Only apply to specific resources:
+
* <code>[[terraform apply -target]]</code>
│ Error: No configuration files
+
[[excluded]] related term
 
│ Apply requires configuration to be present. Applying without a configuration would mark
 
│ everything for destruction, which is normally not what is desired. If you would like to
 
│ destroy everything, run '[[terraform destroy]]' instead.
 
 
  
terraform apply
+
== Execution examples ==
+
* <code>[[terraform apply: ec2 instance example (aws instance)]]</code>
│ Error: Missing required argument
+
* <code>[[terraform apply: modifying ec2 instance size]]</code>
 
│ The argument "region" is required, but was not set.
 
 
  
 +
* [[Terraform apply examples with errors]]
  
<pre>
+
== Related terms ==
An execution plan has been generated and is shown below.
+
* <code>[[terraform show]]</code>
Resource actions are indicated with the following symbols:
+
* <code>[[main.tf]], [[variables.tf]]</code>
 
 
Terraform will perform the following actions:
 
 
 
Plan: 0 to add, 0 to change, 0 to destroy.
 
 
 
Do you want to perform these actions?
 
  Terraform will perform the actions described above.
 
  Only 'yes' will be accepted to approve.
 
 
 
  Enter a value: yes
 
 
 
 
 
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
 
 
 
Outputs:
 
 
 
text = hello world
 
</pre>
 
 
 
== Related commands ==
 
* <code>[[terraform apply]] [[-var]] ‘myvar=football’</code>
 
* <code>[[variables.tf]]</code>
 
 
* <code>[[terraform init]]</code>
 
* <code>[[terraform init]]</code>
 +
* <code>[[terraform destroy]]</code>
 +
* [[Terraform: Hello world.tf]]
 +
* <code>[[Error: failed to render]]</code>
 +
* <code>[[aws cloudformation deploy]]</code>
 +
* [[Deploy EKS cluster using Terraform]]
 +
* <code>[[terragrunt run-all apply]]</code>
 +
* [[aws instance.your instance name will be updated in-place]]
  
 
== See also ==
 
== See also ==
* {{terraform cmd}}
+
* {{main.tf}}
* {{terraform}}
+
* {{terraform apply}}
  
 
[[Category:Terraform]]
 
[[Category:Terraform]]

Latest revision as of 21:07, 22 March 2023

Advertising: