☁️
Cloud Computing
  • Introduction
  • Terminologies
    • Container
    • Kubernetes (K8s)
    • Serverless Computing
  • Services
    • Docker
    • Terraform
  • ☁️Cloud Computing Platforms
    • Google Cloud
      • Google Cloud Essentials
      • Management
        • Cloud IAM
      • Compute
        • Compute Engine
        • Kubernetes Engine
      • Resources
    • IBM Cloud
      • IBM Cloud Shell
      • Compute
      • Containers
      • Developer tools
      • Integration
      • Storage
      • Cloud Paks
    • Microsoft Azure
      • Compute
        • Functions
        • App Services
      • Networking
      • Storage
      • Web
      • Mobile
      • Databases
        • Cosmos DB
      • Analytics
      • AI + Machine Learning
      • Internet of things
      • Security
      • DevOps
      • Monitoring
      • Management and governance
      • Azure Stack
    • Amazon Web Services
    • Resources
  • Qwiklabs Challenge Labs
    • Create and Manage Cloud Resources
    • Deploy and Manage Cloud Environments with Google Cloud
    • Create ML Models with BigQuery ML
    • Insights from Data with BigQuery
    • Build a Website on Google Cloud
    • Build and Deploy a Docker Image to a Kubernetes Cluster
    • Build and Secure Networks in Google Cloud
    • Set Up and Configure a Cloud Environment in Google Cloud
    • Build and Optimize Data Warehouses with BigQuery: Challenge Lab
    • Scale Out and Update a Containerized Application on a Kubernetes Cluster
  • Whizlabs Challenge League
Powered by GitBook
On this page

Was this helpful?

  1. Services

Terraform

an open-source infrastructure-as-code software tool created by HashiCorp.

PreviousDockerNextGoogle Cloud

Last updated 2 years ago

Was this helpful?

  • Terraform is .

  • Terraform is made up of files in the (HCL) and follows a similar structure to JSON or YAML.

  • All Terraform files have the .tf extension.

  • State files are how Terraform keeps track of what it deploys and where. You will NEVER edit the state files directly. They are all managed by Terraform, but you will need to direct Terraform where to deploy the files

    • State files are stored in a shared location where the deployment can get to them.

terraform {
   backend "s3" {
     bucket = "udacity-tf-tscotto"
     key    = "terraform/terraform.tfstate"
     region = "us-east-2"
   }
 }hc

Terraform is made up of blocks. There are 4 types of blocks we will be using:

  • Provider blocks: define cloud providers

provider "aws" {
   region = "us-east-2"
}
  • Resource blocks: define resources

resource "aws_instance" "aws_linux" {
  ami           = ami-074cce78125f09d61
  count         = var.instance_count  // (2)
  instance_type = t2.micro
  tags = {
    Name = "EC2 Instance"
  }
}
  • Variable blocks: define variables

variable "instance_count" {
    description = "The desired number of EC2 instances."
    default     = 2
}
  • Module blocks: define groups of reusable code

Terraform by HashiCorpTerraform by HashiCorp
Logo
https://registry.terraform.io/browse/providers
Module Calls
Logo