Terraform Windows Installation

it is a command line utility that you can download from the website and add to your path

I did a test for windows

PS C:\Users\giuseppe\terraform> .\terraform.exe
usage: terraform [--version] [--help] <command> [args]

The available commands for execution are listed below.
The most common, useful commands are shown first, followed by
less common or more advanced commands. If you're just getting
started with Terraform, stick with the common commands. For the
other commands, please read the help and docs before usage.

Common commands:
    apply              Builds or changes infrastructure

PS C:\Users\giuseppe\terraform> .\terraform.exe -version
Terraform v0.7.1

you can create a first test template in this way
provider "aws" {
    access_key = "xxxxxxxxxxxxxxxx"
    secret_key = "xxxxxxxxxxxxxxxxxxxxxxxxxx"
    region = "sa-east-1"
}

resource "aws_instance" "webserver" {
    ami = "ami-dc48dcb0"
    instance_type = "t2.micro"
}

from the same directory run the command to see what will happen if you really run it
PS C:\Users\giuseppe\terraform> .\terraform.exe plan

+ aws_instance.webserver
    ami:                      "ami-dc48dcb0"
    availability_zone:        "<computed>"
    ebs_block_device.#:       "<computed>"
    ephemeral_block_device.#: "<computed>"
    instance_state:           "<computed>"
    instance_type:            "t2.micro"
    key_name:                 "<computed>"
    network_interface_id:     "<computed>"
PS C:\Users\giuseppe\terraform> .\terraform.exe apply
aws_instance.webserver: Creating...
  ami:                      "" => "ami-dc48dcb0"
  ..............................................................
  source_dest_check:        "" => "true"
  subnet_id:                "" => "<computed>"
  tenancy:                  "" => "<computed>"
  vpc_security_group_ids.#: "" => "<computed>"
aws_instance.webserver: Still creating... (10s elapsed)
aws_instance.webserver: Still creating... (20s elapsed)
aws_instance.webserver: Creation complete

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

The state of your infrastructure has been saved to the path
below. This state is required to modify and destroy your
infrastructure, so keep it safe. To inspect the complete state
use the `terraform show` command.

State path: terraform.tfstate

to see the state of the infrastructure

PS C:\Users\giuseppe\terraform> .\terraform.exe show
aws_instance.webserver:
  id = i-b8599a3a
  ami = ami-dc48dcb0
  availability_zone = sa-east-1a
...........................
  vpc_security_group_ids.# = 1
  vpc_security_group_ids.1478090828 = sg-62e25b07
Salvo diversa indicazione, il contenuto di questa pagina è sotto licenza Creative Commons Attribution-ShareAlike 3.0 License