using_terraform
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
using_terraform [2017/08/05 13:56] – [Terraform Apply] walkeradmin | using_terraform [2023/03/09 22:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Using Terraform ====== | ====== Using Terraform ====== | ||
<color darkorange> | <color darkorange> | ||
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
\\ | \\ | ||
\\ | \\ | ||
---- | ---- | ||
+ | |||
Now that we have our simple Terraform script, we can start to use Terraform. First we need to test the script for any errors, then we can launch our EC2 Instance by running the script. | Now that we have our simple Terraform script, we can start to use Terraform. First we need to test the script for any errors, then we can launch our EC2 Instance by running the script. | ||
\\ | \\ | ||
Line 168: | Line 172: | ||
---- | ---- | ||
- | ==== Terraform ==== | + | ==== Terraform |
+ | \\ | ||
+ | \\ | ||
+ | Terraform Destroy does exactly that, using the script file you created, it undoes all of your settings. When Terraform applied your settings it stored the state of your EC2 Instance, so it already knows what settings have been applied. | ||
+ | \\ | ||
+ | \\ | ||
+ | To use enter the following: | ||
+ | \\ | ||
+ | terraform destroy | ||
+ | \\ | ||
+ | Below is an example output of a terraform destroy command. | ||
+ | \\ | ||
+ | \\ | ||
+ | Before the destroy action is taken, there is a confirmation request. | ||
+ | < | ||
+ | Do you really want to destroy? | ||
+ | Terraform will delete all your managed infrastructure. | ||
+ | There is no undo. Only ' | ||
+ | Enter a value: | ||
+ | </ | ||
+ | \\ | ||
+ | You have to enter <color # | ||
+ | \\ | ||
+ | \\ | ||
+ | Terraform will then issue the command to AWS, depending on the complexity of your EC2 Instance, and what it is doing, the command will take a varying amount of time to complete. | ||
+ | \\ | ||
+ | < | ||
+ | aws_instance.example: | ||
+ | aws_instance.example: | ||
+ | aws_instance.example: | ||
+ | |||
+ | aws_instance.example: | ||
+ | |||
+ | aws_instance.example: | ||
+ | |||
+ | aws_instance.example: | ||
+ | |||
+ | Destroy complete! Resources: 1 destroyed. | ||
+ | </ | ||
+ | \\ | ||
+ | Now you can check your Running Instances to see what has happened. | ||
+ | \\ | ||
+ | \\ | ||
+ | {{ : | ||
+ | \\ | ||
+ | The Instance State will first change to Shutting Down, then to Terminated. Terminated Instances take one or two hours to finally disappear from your Running Instance page. | ||
+ | \\ | ||
+ | \\ |
using_terraform.1501937773.txt.gz · Last modified: 2023/03/09 22:35 (external edit)