day-02-Terraform

Day-02

Terraform Configuration Language Syntax

Step-01: Introduction

-- Understand Terraform Langauge Syntax
-- Understand Blocks
-- Understand Arguments, Attributes & Meta-Arguments
-- Understand identifier
-- Understand Comments

# Template

<BLOCK TYPE> "<BLOCK LABEL>" "<BLOCK Lable>" { # Block body
<IDENTIFIER> = <EXPRESSION> # Argument
}

# AWS Example

resource "aws_instance" "ec2demo" { # Block
ami = "ami-03dceaabddff8067e" # Argument
instance_type = var.instance_type # Argument with value as expression (variable value replaced from variables.tf
}

Step-02: Understand about Arguments, Attributes and Meta-Arguments.

-- Arguments can be 'required' or 'optional'
-- Attributes format looks like resource_type.resource_name.attribute_name
-- Meta-Argument change a resource type's behavior ( Example: count, for_each)

Step-03: Understand about Terraform Top-Level Blocks

-- Discuss about Terraform Top-Level Blocks
- Terraform Settings Block
- Provider Block
- Resource Block
- Input Variable Block
- Output Values Block
- Local Values Block
- Data Source Block
- Modules Block