Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 17

Provision VM(s) to Public Cloud with

Terraform
Boy Suganda Sinaga
VP TechOps & SRE Team
What did we learn last week?

1. What is Terraform?
2. Why Terraform?
3. Basic Installation
4. Basic Syntax
5. Flow
6. …

Flashback? here
WWW.DANA.ID
What’s next?

1. Parts of Terraform Config Language


2. Guide for your first terraform script
3. Hands-On: ECS is fun by using Terraform
> Single ECS
> Multiple ECS
> Autoscaling ECS

WWW.DANA.ID
Parts of Terraform Config Language

1. Provider
2. Variable
3. Resource
4. Module
5. … (https://www.terraform.io/docs/configuration/)

WWW.DANA.ID
How To Identify Them
[PREFIX] [“$Resource_Type”] [“$LOCAL_NAME”] {
[$key] = [$value]
}

WWW.DANA.ID
How To Identify Them (1)

Provider Variable

WWW.DANA.ID
How To Identify Them (2)

Resource

Module

WWW.DANA.ID
How To Identify Them (3)


https://www.terraform.io/docs/configuration/index.html

WWW.DANA.ID
A Guide to write Terraform script
1. Recommended to use this format (terraform-<PROVIDER>-
<NAME>) as repository name
2. Separate your file from others different file (variable.tf, main.tf,
provider.tf, etc.)
3. Create README.md to describe your repository.

WWW.DANA.ID
Hands-On

WWW.DANA.ID
1. Single ECS

WWW.DANA.ID
2. Multiple ECS

WWW.DANA.ID
3. Autoscaling ECS

WWW.DANA.ID
Challenge?
1. Create 2 instance (an instance Zone A, and an instance Zone B)
2. Private IP
3. SLB (Public IP)
4. the VServer is both instance (for SLB)
5. Frontend and Backend Port are HTTP

WWW.DANA.ID
Thank You!
References
1. Guideline for writing Terraform Script
2. File Structure
3. Demos Session

You might also like