Skip to content

armandwipangestu/example-terraform-infra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Terraform Banner

Example Terraform Infra

Learn how to make Infrastructure as Code (IaC) with Terraform to safely and predictable create, change, and improve infrastructure.

Initialize Terraform

terraform init

The output should look like this:

* provider.google: version = "~> 4.43.0"
Terraform has been successfully initialized!

Rewrite Terraform configuration file to a canonical format and style

terraform fmt

The output should look like this:

mynetwork.tf

Initialize Terraform

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!

Create Execution Plan

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

Apply desired changes

terraform apply

To confirm the planned actions, type yes

The output should look like this:

...
Apply complete! Resources: 4 added, 0 changed, 0 destroyed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages