Data Warehousing
  • Data Warehousing
  • Readme
  • Fundamentals
    • Terms to Know
    • Jobs
    • Skills needed for DW developer
    • Application Tiers
    • Operational Database
    • What is a Data Warehouse
      • Typical Data Architecture
      • Problem Statement
      • Features of Data Warehouse
      • Need for Data Warehouse
      • Current State of the Art
    • Activities of Data Science
    • Types of Data
    • Data Storage Systems
    • Data Warehouse 1980 - Current
    • Data Warehouse vs Data Mart
    • Data Warehouse Architecture
      • Top-Down Approach
      • Bottom-Up Approach
    • Data Warehouse Characteristic
      • Subject Oriented
      • Integrated
      • Time Variant
      • Non Volatile
    • Tools
    • Cloud vs On-Premise
    • Steps to design a Data Warehouse
      • Gather Requirements
      • Environment
      • Data Modeling
      • Choosing ETL / ELT Solution
      • Online Analytic Processing
      • Front End
      • Query Optimization
    • Dataset Examples
    • Thoughts on some data
  • RDBMS
    • Data Model
      • Entity Relationship Model
      • Attributes
      • Keys
      • Transaction
      • ACID
    • Online vs Batch
    • DSL vs GPL
    • Connect to Elvis
    • SQL Concepts
      • Basic Select - 1
      • Basic Select - 2
      • UNION Operators
      • Wild Cards & Distinct
      • Group By & Having
      • Sub Queries
      • Derived Tables
      • Views
    • Practice using SQLBolt
  • Cloud
    • Overview
    • Types of Cloud Services
    • Challenges of Cloud Computing
    • AWS
      • AWS Global Infrastructure
      • EC2
      • S3
      • IAM
    • Terraform
  • Spark - Databricks
    • Storage Formats
    • File Formats
    • Medallion Architecture
    • Delta
  • Data Warehousing Concepts
    • Dimensional Modelling
      • Star Schema
      • Galaxy Schema
      • Snowflake Schema
      • Starflake Schema
      • Star vs Snowflake
      • GRAIN
      • Multi-Fact Star Schema
      • Vertabelo Tool
    • Dimension - Fact
    • Sample Excercise
    • Keys
      • Why Surrogate Keys are Important
    • More Examples
    • Master Data Management
    • Steps of Dimensional Modeling
    • Types of Dimensions
      • Date Dimension Table
      • Degenerate Dimension
      • Junk Dimension
      • Static Dimension
      • Conformed Dimensions
      • Slowly Changing Dimensions
        • SCD - Type 0
        • SCD - Type 1
        • SCD - Type 2
        • SCD - Type 3
        • SCD - Type 4
        • SCD - Type 6
        • SCD - Type 5 - Fun Fact
      • Role Playing Dimension
      • Conformed vs Role Playing
      • Shrunken Dimension
      • Swappable Dimension
      • Step Dimension
    • Types of Facts
      • Factless Fact Table
      • Transaction Fact
      • Periodic Fact
      • Accumulating Snapshot Fact Table
      • Transaction vs Periodic vs Accumulating
      • Additive, Semi-Additive, Non-Additive
      • Periodic Snapshot vs Additive
      • Conformed Fact
    • Sample Data Architecture Diagram
    • Data Pipeline Models
    • New DW Concepts
Powered by GitBook
On this page
  • Install Terraform CLI
  • Linux / Mac Users
  • Windows Users
  • Terraform
  1. Cloud

Terraform

PreviousIAMNextStorage Formats

Last updated 2 years ago

Infrastructure as a Code.

Its Cloud agnostic - Open Source provisioning tool

It's written in the Go language.

  • Speed and Simplicity

  • Team Collaboration

  • Error Reduction

  • Disaster Recovery

  • Enhanced Security

Install Terraform CLI

Please make sure AWS Profile is created.

Create Public and Private Keys

Linux / Mac Users

// create private/public key

ssh-keygen -b 2048 -t rsa -f ec2_tf_demo

Windows Users

Open PuttyGen and create a Key

Terraform

  • mkdir tf-aws-ec2-sample

  • cd tf-aws-ec2-sample

  • Create main.tf

  • Copy the contents of main.tf

// main.tf
#https://registry.terraform.io/providers/hashicorp/aws/latest

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.51"
    }
  }

  required_version = ">= 1.2.0"
}

provider "aws" {
  profile = "chandr34"
  region = "us-east-1"
}

resource "aws_key_pair" "my_key_pair" {
  key_name   = "my_key_pair"
  public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDA8Ez4AejUjTLhurpwanyxUKdCsrQXshtve4nXLX9/My47TqZ5NQXI7R8o+vzXKejDOHdjD4vzGA9l8nk7blJBlE4nihzN2aDRbRMZV/ttkn3zDGusDH6obKoyGgH+deZvzB06Jp229I5w/U18vd0UdwAqrArzq/o3GLq7wjnTatOaJIS/Ex1KsZJa9wv1sGs6RPBWxW4LIl9Kbu6j8I9ZXg0608R7cEqu0gur2nyJNLRG5mcqvg21BQ1ia3vOg0BRxo25SyPhFKB4TXl51mQuFxJnVDEakPxmrJjnUaxeaenJ0E8nc21+mWe3h8KeKKVfeHeREvOS7JqGYolxgGc7 ganesh.chandra@FK33CY9K9H"
  #public_key = file("file.pub")
}

resource "aws_instance" "app_server" {
  ami           = "ami-00874d747dde814fa"
  instance_type = "t2.micro"
  key_name = aws_key_pair.my_key_pair.key_name

  tags = {
    Name = "GC Ubuntu Via TF"
  }
}

resource "aws_security_group" "gc_ec2_linux_sg" {
  name = "gc_ec2_linux_sg"

  #Incoming traffic
  ingress {
    from_port = 22
    to_port = 22
    protocol = "tcp"
    cidr_blocks = ["0.0.0.0/0"] #replace it with your ip address
  }

  #Outgoing traffic
  egress {
    from_port = 0
    protocol = "-1"
    to_port = 0
    cidr_blocks = ["0.0.0.0/0"]
  }
}

goto terminal

  • terraform init

  • terraform fmt

  • terraform validate

  • terraform apply

  • terraform show

Finally

  • terraform destroy

LogoInstall | Terraform | HashiCorp DeveloperInstall | Terraform | HashiCorp Developer