
Īpply complete! Resources: 0 added, 0 changed, 0 destroyed. We can now verify that the file has been created with the specified content: $ cat hello.txtĪll good! Now, let's see what happens if we rerun the apply command, this time using the -auto-approve flag so Terraform goes right away without asking for any confirmation: $ terraform apply -auto-approve Local_file.hello: Creation complete after 0s Īpply complete! Resources: 1 added, 0 changed, 0 destroyed. Terraform will perform the actions described above. Resource actions are indicated with the following symbols: We can now proceed to actual resource creation using the apply command: $ terraform applyĪn execution plan has been generated and is shown below. As we haven't supplied those in our resource definition, the provider will assume default values. We can also see the provided values we've set and a pair of permission attributes. Here, Terraform is telling us that it needs to create a new resource, which is expected as it doesn't exist yet. Plan: 1 to add, 0 to change, 0 to destroy.

Terraform will perform the following actions: This step works pretty much as the “dry run” feature available in other build systems, such as GNU's make tool: $ terraform plan Next, we use the plan command to verify what actions Terraform will perform to create our resources. In this step, Terraform scans our project files and downloads any required provider - the local provider, in our case. Terraform has been successfully initialized! Downloading plugin for provider "local" (hashicorp/local) 1.4.0.

Checking for available provider plugins.

This resource type, as the name implies, is just a file on the local file system with the given content. Next, we have a resource definition named hello of type local_file.

The provider declaration states that we'll use the local provider at version 1.4 or a compatible one. The main.tf file contains two blocks: a provider declaration and a resource definition. Let's go ahead and see how this looks like by opening the command shell and typing a few commands: $ cd $HOME tf, use Terraform's configuration language to define the resources we want to create.įor our “Hello, Terraform” project, our resource will be just a file with fixed content. A Terraform project is just a set of files in a directory containing resource definitions.
