User Tools

Site Tools


devops:terraform

This is an old revision of the document!


Table of Contents

Terraform

Installation https://askubuntu.com/questions/983351/how-to-install-terraform-in-ubuntu

Introduction: https://www.terraform.io/intro/getting-started/build.html

Apply terraform bash script


#!/bin/bash
set -eo pipefail

if [[ ! -d ".terraform" ]]
then
  terraform init
fi

terraform validate
terraform plan

#terraform apply


Variables

Create “variables.tf”


variable "region" {
  description = "Value of the Name tag for the EC2 instance"
  type = string
  default = "eu-west-1"
}


Use the variable


provider "aws" {
  profile = "default"
  region  = var.region
}

devops/terraform.1622054185.txt.gz · Last modified: by skipidar