
In this example, the instance_name
variable is defined with a type of string
, and it is given a default value of "my-instance"
. The AWS provider is then configured to use the us-west-2
region.
The aws_instance
resource is used to launch Amazon EC2 instances. The tags
argument is used to assign a name tag to the instance, and it is set to the value of the instance_name
variable.
You can change the value of instance_name
by modifying the default value in the variable definition, or you can specify a different value when you run Terraform by using the -var
flag. For example, if you want to launch an instance with the name "my-other-instance"
, you can run the following command:
$ terraform apply -var ‘instance_name=”my-other-instance”‘


Terraform Basic Tutorial with Demo by Piyush 2020

Terraform Fundamental Tutorials by Harish in 2020

Terraform Fundamental Tutorial By Guru in 2020 Part-1

Terraform Fundamental Tutorial By Guru in 2020 Part-2

Terraform Fundamental Tutorial By Guru in 2020 Part-3

Terraform Fundamental Tutorial By Guru in 2020 Part-4

Terraform Fundamental Tutorial By Guru in 2020 Part-5

Terraform Advance Tutorial for Beginners with Demo 2020 — By DevOpsSchool

Latest posts by Rajesh Kumar (see all)
- Packer Tutorials: Amazon Secrets Manager Data Source – amazon-secretsmanager - May 25, 2023
- Packer Tutorials: Amazon Data Sources – amazon-parameterstore - May 25, 2023
- What is DevSecTestOps? - May 25, 2023