Learn how to make Infrastructure as Code (IaC) with Terraform to safely and predictable create, change, and improve infrastructure.
terraform init
The output should look like this:
* provider.google: version = "~> 4.43.0"
Terraform has been successfully initialized!
terraform fmt
The output should look like this:
mynetwork.tf
terraform init
The output should look like this:
Initializing modules...
- mynet-eu-vm in instance
- mynet-us-vm in instance
...
* provider.google: version = "~> 4.43.0"
Terraform has been successfully initialized!
terraform plan
The output should look like this:
...
Plan: 4 to add, 0 to change, 0 to destroy.
...
Terraform determined that the following 4 resources need to be added:
Name | Description |
---|---|
mynetwork | VPC network |
mynetwork-allow-http-ssh-rdp-icmp | Firewall rule to allow HTTP, SSH, RDP, and ICMP |
mynet-us-vm | VM instance in us-central1-a |
mynet-eu-vm | VM instance in europe-west1-a |
terraform apply
To confirm the planned actions, type yes
The output should look like this:
...
Apply complete! Resources: 4 added, 0 changed, 0 destroyed.