Big Data & Tools with NoSQL
  • Big Data & Tools
  • ReadMe
  • Big Data Overview
    • Overview
    • Job Opportunities
    • What is Data?
    • How does it help?
    • Types of Data
    • The Big 4 V's
      • Variety
      • Volume
      • Velocity
      • Veracity
      • Other V's
    • Trending Technologies
    • Big Data Concerns
    • Big Data Challenges
    • Data Integration
    • Scaling
      • CAP Theorem
      • Optimistic concurrency
      • Eventual consistency
      • Concurrent vs. Parallel Programming
    • Big Data Tools
    • No SQL Databases
    • What does Big Data learning means?
  • Linux & Tools
    • Overview
    • Linux Commands - 01
    • Linux Commands - 02
    • AWK
    • CSVKIT
    • CSVSQL
    • CSVGREP
  • Data Format
    • Storage Formats
    • CSV/TSV/Parquet
    • Parquet Example
    • JSON
    • HTTP & REST API
      • Terms to Know
        • Statefulness
        • Statelessness
        • Monolithic Architecture
        • Microservices
        • Idempotency
    • REST API
    • Python
      • Setup
      • Decorator
      • Unit Testing
      • Flask Demo
      • Flask Demo - 01
      • Flask Demo - 02
      • Flask Demo - 03
      • Flask Demo - 04
      • Flask Demo - 06
    • API Testing
    • Flask Demo Testing
    • API Performance
    • API in Big Data World
  • NoSQL
    • Types of NoSQL Databases
    • Redis
      • Overview
      • Terms to know
      • Redis - (RDBMS) MySql
      • Redis Cache Demo
      • Use Cases
      • Data Structures
        • Strings
        • List
        • Set
        • Hash
        • Geospatial Index
        • Pub/Sub
        • Redis - Python
      • Redis JSON
      • Redis Search
      • Persistence
      • Databases
      • Timeseries
    • Neo4J
      • Introduction
      • Neo4J Terms
      • Software
      • Neo4J Components
      • Hello World
      • Examples
        • MySQL: Neo4J
        • Sample Transactions
        • Sample
        • Create Nodes
        • Update Nodes
        • Relation
        • Putting it all together
        • Commonly used Functions
        • Data Profiling
        • Queries
        • Python Scripts
      • More reading
    • MongoDB
      • Sample JSON
      • Introduction
      • Software
      • MongoDB Best Practices
      • MongoDB Commands
      • Insert Document
      • Querying MongoDB
      • Update & Remove
      • Import
      • Logical Operators
      • Data Types
      • Operators
      • Aggregation Pipeline
      • Further Reading
      • Fun Task
        • Sample
    • InfluxDB
      • Data Format
      • Scripts
  • Python
    • Python Classes
    • Serialization-Deserialization
  • Tools
    • JQ
    • DUCK DB
    • CICD Intro
    • CICD Tools
      • CI YAML
      • CD Yaml
    • Containers
      • VMs or Containers
      • What container does
      • Podman
      • Podman Examples
  • Cloud Everywhere
    • Overview
    • Types of Cloud Services
    • Challenges of Cloud Computing
    • High Availability
    • Azure Cloud
      • Services
      • Storages
      • Demo
    • Terraform
  • Data Engineering
    • Batch vs Streaming
    • Kafka
      • Introduction
      • Kafka Use Cases
      • Kafka Software
      • Python Scripts
      • Different types of Streaming
    • Quality & Governance
    • Medallion Architecture
    • Data Engineering Model
    • Data Mesh
  • Industry Trends
    • Roadmap - Data Engineer
    • Good Reads
      • IP & SUBNET
Powered by GitBook
On this page
  1. Cloud Everywhere

Terraform

PreviousDemoNextBatch vs Streaming

Last updated 1 year ago

(If Time Permits)

Infrastructure as a Code.

Its Cloud agnostic - Open Source provisioning tool

Written in Go language.

  • Speed and Simplicity

  • Team Collaboration

  • Error Reduction

  • Disaster Recovery

  • Enhanced Security

main.tf

terraform {
  required_version = ">=1.0"

  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "~>3.0"
    }
    random = {
      source  = "hashicorp/random"
      version = "~>3.0"
    }
  }
}

provider "azurerm" {
  features {}

  subscription_id = "88ed8ca7d72f0589"
  client_id       = "30174d17-b192-30806a9b50ee"
  client_secret   = "e4H8Q~UOKvXS-q6VN7Jj9K~tic88"
  tenant_id       = "27e52f18-4-c8781beadaad"
}

resource "azurerm_resource_group" "bigdataclass" {
  name     = "bigdataclass-resources"
  location = "East US"
}

resource "azurerm_virtual_network" "bigdataclass" {
  name                = "bigdataclass-network"
  address_space       = ["10.0.0.0/16"]
  location            = azurerm_resource_group.bigdataclass.location
  resource_group_name = azurerm_resource_group.bigdataclass.name
}

resource "azurerm_subnet" "bigdataclass" {
  name                 = "internal"
  resource_group_name  = azurerm_resource_group.bigdataclass.name
  virtual_network_name = azurerm_virtual_network.bigdataclass.name
  address_prefixes     = ["10.0.2.0/24"]
}

resource "azurerm_public_ip" "bigdataclass" {
  name                = "bigdataclass-publicip"
  location            = azurerm_resource_group.bigdataclass.location
  resource_group_name = azurerm_resource_group.bigdataclass.name
  allocation_method   = "Dynamic"
  sku                 = "Basic"
}


resource "azurerm_network_interface" "bigdataclass" {
  name                = "bigdataclass-nic"
  location            = azurerm_resource_group.bigdataclass.location
  resource_group_name = azurerm_resource_group.bigdataclass.name

  ip_configuration {
    name                          = "internal"
    subnet_id                     = azurerm_subnet.bigdataclass.id
    private_ip_address_allocation = "Dynamic"
    public_ip_address_id          = azurerm_public_ip.bigdataclass.id
  }
}


resource "azurerm_linux_virtual_machine" "bigdataclass" {
  name                = "bigdataclass-vm"
  resource_group_name = azurerm_resource_group.bigdataclass.name
  location            = azurerm_resource_group.bigdataclass.location
  size                = "Standard_DS1_v2"
  admin_username      = "adminuser"
  admin_password      = "B1GD@t@Tu3"
  disable_password_authentication = false

  network_interface_ids = [
    azurerm_network_interface.bigdataclass.id,
  ]

  /*
  admin_ssh_key {
    username   = "adminuser"
    public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC..."
  }
  */

  os_disk {
    caching              = "ReadWrite"
    storage_account_type = "Standard_LRS"
  }

  source_image_reference {
    publisher = "Canonical"
    offer     = "UbuntuServer"  
    sku       = "19.04"
    version   = "latest"
  }
}

terraform init

terraform plan

terraform apply

terraform destroy

https://developer.hashicorp.com/terraform/downloads