Note_Tech

All technological notes.


Project maintained by simonangel-fong Hosted on GitHub Pages — Theme by mattgraham

Terraform - IaC

Back


IaC


Terraform

# AWS provider
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 6.0"
    }
  }
}

# custom provider
terraform {
    required_providers{
        mycloud = {
            version = ">= 1.0.0"
            source = "mycorp/mycloud"   # tf cloud's private registry
        }
    }

    required_version = ">= 0.14"
}

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

provider "aws" {
    alias = "eu"        # using alias
    region = "eu-west-1"
}

resource "aws_instance" "myinstance"{
    provider = aws.eu
}

module "mymodule" {
    source = "./mymodule"
    providers = {
        aws = aws.eu
    }
}

Terraform provider versioning


Provisioner