Description

Hands-on Challenge Day - Terraform on Azure: Blob Storage Setup

Introduction

The Power of Infrastructure as Code with Terraform

Infrastructure as Code (IaC) is a key DevOps practice, enabling developers and IT professionals to automate the provisioning and management of infrastructure. Terraform, by HashiCorp, is an open-source tool that allows you to define both cloud and on-premises resources in human-readable configuration files that can be versioned, reused, and shared.

Why Azure Blob Storage?

Azure Blob Storage is Microsoft Azure's object storage solution for the cloud. It is optimized for storing massive amounts of unstructured data, such as text or binary data, which makes it ideal for serving images or documents directly to a browser, storing files for distributed access, streaming video and audio, and storing backup and restore, disaster recovery, and archiving data.

Challenge Scenario

"GlobalMedia Inc." is an international news organization with terabytes of multimedia content. They need a scalable, secure, and cost-effective storage solution to archive their vast media library. They've decided to utilize Azure Blob Storage for its scalability and robustness and have chosen Terraform to automate the provisioning and management of their cloud infrastructure.

Problem Statement: GlobalMedia Inc. requires an automated way to provision and configure Azure Blob Storage to store, manage, and access its multimedia content efficiently.

Your Mission: Utilize Terraform to automate the creation and configuration of Azure Blob Storage for GlobalMedia Inc., ensuring it meets their scalability, security, and accessibility needs.

Challenge: Automating Azure Blob Storage Setup with Terraform

Requirements:

  1. Azure Account: Access to a Microsoft Azure account.
  2. Terraform Installed: Terraform CLI installed on your machine.

Steps:

  1. Set Up Terraform Provider for Azure:

    **provider.tf:**

    provider "azurerm" {
      features {}
    }
    
    
  2. Define the Azure Resource Group:

    resource_group.tf:

    resource "azurerm_resource_group" "globalmedia" {
      name     = "GlobalMediaResources"
      location = "East US"
    }
    
    
  3. Configure Azure Storage Account:

    storage_account.tf:

    resource "azurerm_storage_account" "globalmediastorage" {
      name                     = "globalmediastorage"
      resource_group_name      = azurerm_resource_group.globalmedia.name
      location                 = azurerm_resource_group.globalmedia.location
      account_tier             = "Standard"
      account_replication_type = "GRS"
    
      tags = {
        environment = "Archive"
      }
    }
    
    
  4. Set Up a Blob Container:

    blob_container.tf:

    resource "azurerm_storage_container" "media_container" {
      name                  = "mediacontent"
      storage_account_name  = azurerm_storage_account.globalmediastorage.name
      container_access_type = "blob"
    }