Terraform Oct Day 3 Notes

DevOps

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Teraraform Modules

How to Use Module Dev by others?
How to write your own Module?
=====================================
What is module?
-----------------------------
Is a Dir which contains
	- tf
	- tfvars
-----------------------------
	ROOT MODULE
		Child Module
Dir
	main.tf
	<module1>
	<module2>
	Module1
		main.tf
		terraform.tfvars
	Module2
		main.tf
		terraform.tfvars
	Module3
		main.tf
		terraform.tfvars

EXAMPLE
https://github.com/Azure/terraform-azurerm-vnet/tree/main/examples
https://registry.terraform.io/modules/Azure/vnet/azurerm/latest?tab=inputs

https://www.devopsschool.com/blog/terraform-modules-explained/

Terraform Workspace

Terraform Backends

terraform {
  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
      version = "3.75.0"
    }
	aws = {
      source = "hashicorp/aws"
      version = "5.20.0"
    }
	github = {
      source = "integrations/github"
      version = "5.39.0"
    }
  }
  backend "azurerm" {
    resource_group_name  = "eksuw01-rg"
    storage_account_name = "eksuw01sa"
    container_name       = "rajesh"
    key                  = "prod.terraform.tfstate"
	subscription_id = "b3dbe884-c3dc"
    client_id       = "6046fe74-dfd2-4"
    client_secret   = "3XJ8Q~uvlwVL"
    tenant_id       = "f34c8fc4-16b"
  }
}
provider "azurerm" {
  features {}
  subscription_id = "b3dbe884c"
  client_id       = "6046fe74-d"
  client_secret   = "3XJ8Q~uvlwV"
  tenant_id       = "f34c8fc4-1"
}

Terraform Templates

Terraform Function

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x