Terraform: Difference between revisions

From Halfface
Jump to navigation Jump to search
Line 5: Line 5:
Hardcoded install
Hardcoded install
  cd /tmp/ ; curl -sk -L https://releases.hashicorp.com/terraform/1.5.5/terraform_1.5.5_linux_amd64.zip -O ; cd /usr/bin/ ; sudo unzip /tmp/terraform_1.5.5_linux_amd64.zip
  cd /tmp/ ; curl -sk -L https://releases.hashicorp.com/terraform/1.5.5/terraform_1.5.5_linux_amd64.zip -O ; cd /usr/bin/ ; sudo unzip /tmp/terraform_1.5.5_linux_amd64.zip
=file completion=
complete -C /usr/bin/terraform terraform
=Remove terraform infrastructure=
=Remove terraform infrastructure=
  terraform destroy
  terraform destroy
=show=
=show=
Show what has been done.
Show what has been done.

Revision as of 12:24, 18 October 2023

install terraform

sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
sudo dnf install terraform

Hardcoded install

cd /tmp/ ; curl -sk -L https://releases.hashicorp.com/terraform/1.5.5/terraform_1.5.5_linux_amd64.zip -O ; cd /usr/bin/ ; sudo unzip /tmp/terraform_1.5.5_linux_amd64.zip

file completion

complete -C /usr/bin/terraform terraform

Remove terraform infrastructure

terraform destroy

show

Show what has been done.

terraform show

state

list resources within a Terraform state.

terraform state list

Show more info about individual entity.

terraform state show openstack_networking_network_v2.net3

plan

Creates an execution plan, which lets you preview the changes that Terraform plans to make to your infrastructure.

terraform plan

apply

Performs a plan just like terraform plan does, but then actually carries out the planned changes to each resource using the relevant infrastructure provider's API.

terraform apply